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~4 X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=e288377a51e314be485acab14fa27e0b79149d0c;p=znc-palaver.git fix: Local notifications may appear twice --- diff --git a/palaver.cpp b/palaver.cpp index 8bd5a03..a121c22 100644 --- a/palaver.cpp +++ b/palaver.cpp @@ -319,6 +319,19 @@ public: return bHasNetwork; } + bool IsNetworkConnected(const CIRCNetwork& m_pNetwork) const { + bool bIsConnected = false; + + for (CClient* pClient : m_pNetwork.GetClients()) { + if (this->HasClient(*pClient)){ + bIsConnected = true; + break; + } + } + + return bIsConnected; + } + bool AddNetworkNamed(const CString& sUsername, const CString& sNetwork, const CString& sNetworkID) { bool bDidAddNetwork = false; @@ -1067,7 +1080,7 @@ public: continue; } - if (device.HasNetwork(*m_pNetwork)) { + if (device.IsNetworkConnected(*m_pNetwork)) { bool bMention = ( ((pChannel == NULL) || device.HasMentionChannel(pChannel->GetName())) || device.HasMentionNick(Nick.GetNick()) ||