aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Fabio Bas2010-05-10 15:36:02 +0000
committerGravatar Fabio Bas2010-05-10 15:36:02 +0000
commit909f82ade571cca444258d93e01d4144a701ea02 (patch)
tree15d75a28f09fd1275ad4871c24dc307ba3ea5c06 /src
parentfix for a regression in log saving introduced in r4265 (diff)
downloadKVIrc-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
Diffstat (limited to 'src')
-rw-r--r--src/kvilib/irc/kvi_network.cpp18
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;
}