Force parsing of PREFIX in RPL_ISUPPORT. Fixes #936
authorHendrik Leppkes <h.leppkes@gmail.com>
Tue, 27 Jul 2010 13:50:33 +0000 (15:50 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 11 Aug 2010 14:31:01 +0000 (16:31 +0200)
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.

src/common/network.cpp
src/common/network.h
src/core/ircserverhandler.cpp

index d7b2149..900330b 100644 (file)
@@ -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++) {
index f0bd112..5278617 100644 (file)
@@ -170,6 +170,7 @@ public:
 
   QString prefixes();
   QString prefixModes();
+  void determinePrefixes();
 
   bool supports(const QString &param) const { return _supports.contains(param); }
   QString support(const QString &param) const;
@@ -358,8 +359,6 @@ private:
   bool _unlimitedReconnectRetries;
   bool _rejoinChannels;
 
-  void determinePrefixes();
-
   QTextCodec *_codecForServer;
   QTextCodec *_codecForEncoding;
   QTextCodec *_codecForDecoding;
index ea59836..4ee153e 100644 (file)
@@ -623,6 +623,9 @@ void IrcServerHandler::handle005(const QString &prefix, const QList<QByteArray>
     QString value = rawSupport.section("=", 1);
     network()->addSupport(key, value);
   }
+
+  /* determine our prefixes here to get an accurate result */
+  network()->determinePrefixes();
 }
 
 /* RPL_UMODEIS - "<user_modes> [<user_mode_params>]" */