From: Hendrik Leppkes Date: Tue, 27 Jul 2010 13:50:33 +0000 (+0200) Subject: Force parsing of PREFIX in RPL_ISUPPORT. Fixes #936 X-Git-Tag: 0.6.2~9 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=8d0f43088ae079115d8021f9a451e3e578f362dd Force parsing of PREFIX in RPL_ISUPPORT. Fixes #936 In some cases the automatic parsing of PREFIX was actually triggered before RPL_ISUPPORT was actually received. In this case the internal prefix configuration would only contain the default modes, and not the network specific modes, which would cause custom modes to be ignored completly. This patch forces the parsing of PREFIX directly after RPL_ISUPPORT was received, and the data is available. --- diff --git a/src/common/network.cpp b/src/common/network.cpp index d7b21496..900330bd 100644 --- a/src/common/network.cpp +++ b/src/common/network.cpp @@ -749,6 +749,9 @@ void Network::determinePrefixes() { _prefixModes = defaultPrefixModes; return; } + // clear the existing modes, just in case we're run multiple times + _prefixes = QString(); + _prefixModes = QString(); // we just assume that in PREFIX are only prefix chars stored for(int i = 0; i < defaultPrefixes.size(); i++) { diff --git a/src/common/network.h b/src/common/network.h index f0bd112c..52786176 100644 --- a/src/common/network.h +++ b/src/common/network.h @@ -170,6 +170,7 @@ public: QString prefixes(); QString prefixModes(); + void determinePrefixes(); bool supports(const QString ¶m) const { return _supports.contains(param); } QString support(const QString ¶m) const; @@ -358,8 +359,6 @@ private: bool _unlimitedReconnectRetries; bool _rejoinChannels; - void determinePrefixes(); - QTextCodec *_codecForServer; QTextCodec *_codecForEncoding; QTextCodec *_codecForDecoding; diff --git a/src/core/ircserverhandler.cpp b/src/core/ircserverhandler.cpp index ea598368..4ee153ee 100644 --- a/src/core/ircserverhandler.cpp +++ b/src/core/ircserverhandler.cpp @@ -623,6 +623,9 @@ void IrcServerHandler::handle005(const QString &prefix, const QList QString value = rawSupport.section("=", 1); network()->addSupport(key, value); } + + /* determine our prefixes here to get an accurate result */ + network()->determinePrefixes(); } /* RPL_UMODEIS - " []" */