From: Dennis Collaris Date: Tue, 18 Sep 2018 11:37:41 +0000 (+0200) Subject: fix: Local notifications may appear twice X-Git-Tag: 1.1.2~2 X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=b1785b78058ccb74b1535b3e1f33c6be5e72300a;p=znc-palaver.git fix: Local notifications may appear twice --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b101b6..7a71401 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog for Palaver ZNC Module +## Master + +### Bug Fixes + +- Fix issue where local notifications may appear twice. + ## 1.1.1 ### Bug Fixes diff --git a/palaver.cpp b/palaver.cpp index 8bd5a03..9f689f8 100644 --- a/palaver.cpp +++ b/palaver.cpp @@ -319,6 +319,19 @@ public: return bHasNetwork; } + bool IsNetworkConnected(const CIRCNetwork& network) const { + bool bIsConnected = false; + + for (CClient* pClient : network.GetClients()) { + if (pClient && this->HasClient(*pClient)){ + bIsConnected = true; + break; + } + } + + return bIsConnected; + } + bool AddNetworkNamed(const CString& sUsername, const CString& sNetwork, const CString& sNetworkID) { bool bDidAddNetwork = false; @@ -1063,7 +1076,7 @@ public: { CDevice& device = **it; - if (m_pClient && device.HasClient(*m_pClient)) { + if (device.IsNetworkConnected(*m_pNetwork)) { continue; }