fix: Local notifications may appear twice
authorDennis Collaris <redacted>
Tue, 18 Sep 2018 11:37:41 +0000 (13:37 +0200)
committerDennis Collaris <redacted>
Tue, 18 Sep 2018 11:37:41 +0000 (13:37 +0200)
palaver.cpp

index 8bd5a0394ae0f7ba9f4030b68bdef83dc51a85f1..a121c22dd7226b852392c4455bdbbe225fc2b9bd 100644 (file)
@@ -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()) ||
git clone https://git.99rst.org/PROJECT