diff options
| author | 2010-05-10 15:36:02 +0000 | |
|---|---|---|
| committer | 2010-05-10 15:36:02 +0000 | |
| commit | 909f82ade571cca444258d93e01d4144a701ea02 (patch) | |
| tree | 15d75a28f09fd1275ad4871c24dc307ba3ea5c06 | |
| parent | fix for a regression in log saving introduced in r4265 (diff) | |
| download | KVIrc-909f82ade571cca444258d93e01d4144a701ea02.tar.gz KVIrc-909f82ade571cca444258d93e01d4144a701ea02.tar.bz2 KVIrc-909f82ade571cca444258d93e01d4144a701ea02.zip | |
fix for #783
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4314 17fca916-40b9-46aa-a4ea-0a15b648b75c
| -rw-r--r-- | src/kvilib/irc/kvi_network.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/kvilib/irc/kvi_network.cpp b/src/kvilib/irc/kvi_network.cpp index 9ac0b7fb2..5ea4a9d15 100644 --- a/src/kvilib/irc/kvi_network.cpp +++ b/src/kvilib/irc/kvi_network.cpp @@ -117,10 +117,20 @@ KviServer * KviNetwork::findServer(const KviServer * pServer) { for (KviServer *s = m_pServerList->first(); s; s = m_pServerList->next()) { - if (KviQString::equalCI(s->m_szHostname, pServer->m_szHostname) - && (s->m_uPort == pServer->m_uPort) && (s->useSSL() - == pServer->useSSL()) && (s->isIPv6() == pServer->isIPv6())) - return s; + // we better go with the unique id first + if(!s->m_szId.isEmpty()) + { + // at least one of the 2 id is not empty, so if they match we're done + if(KviQString::equalCI(s->m_szId, pServer->m_szId)) + return s; + } else { + // failback on the "check everything" method + + if (KviQString::equalCI(s->m_szHostname, pServer->m_szHostname) + && (s->m_uPort == pServer->m_uPort) && (s->useSSL() + == pServer->useSSL()) && (s->isIPv6() == pServer->isIPv6())) + return s; + } } return 0; } |
