From f0013829ab979864e1cbf23c0195485c5d7ccb72 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 27 Jul 2010 15:50:33 +0200 Subject: [PATCH] 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. --- src/common/network.cpp | 3 +++ src/common/network.h | 3 +-- src/core/ircserverhandler.cpp | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/common/network.cpp b/src/common/network.cpp index 6eccc9bc..ed8b35a6 100644 --- a/src/common/network.cpp +++ b/src/common/network.cpp @@ -748,6 +748,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 6bce3d91..236269ac 100644 --- a/src/common/network.h +++ b/src/common/network.h @@ -171,6 +171,7 @@ public: QString prefixes(); QString prefixModes(); + void determinePrefixes(); bool supports(const QString ¶m) const { return _supports.contains(param); } QString support(const QString ¶m) const; @@ -360,8 +361,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 ef42086d..32a40f0d 100644 --- a/src/core/ircserverhandler.cpp +++ b/src/core/ircserverhandler.cpp @@ -650,6 +650,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 - " []" */ -- 2.20.1