X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcoresessioneventprocessor.cpp;h=82da78174a0ebd4fb6a9eb629793c7b12030f0b5;hb=7e72235113a6677c46f6be55b58ef101c47d0080;hp=43f44dba7ed7fc5f96e351ae2b52e543a23b2687;hpb=ba1c9e7925671c1393e0ff6b140f68a3dc1fe3cf;p=quassel.git diff --git a/src/core/coresessioneventprocessor.cpp b/src/core/coresessioneventprocessor.cpp index 43f44dba..82da7817 100644 --- a/src/core/coresessioneventprocessor.cpp +++ b/src/core/coresessioneventprocessor.cpp @@ -942,8 +942,22 @@ void CoreSessionEventProcessor::processIrcEvent352(IrcEvent *e) // Some IRC servers decide to not follow the spec, returning only -some- of the user // modes in WHO despite listing them all in NAMES. For now, assume it can only add // and not take away. *sigh* - if (!validModes.isEmpty()) - ircuser->addUserModes(validModes); + if (!validModes.isEmpty()) { + if (channel != "*") { + // Channel-specific modes received, apply to given channel only + IrcChannel *ircChan = e->network()->ircChannel(channel); + if (ircChan) { + // Do one mode at a time + // TODO Better way of syncing this without breaking protocol? + for (int i = 0; i < validModes.count(); ++i) { + ircChan->addUserMode(ircuser, validModes.at(i)); + } + } + } else { + // Modes apply to the user everywhere + ircuser->addUserModes(validModes); + } + } } } @@ -987,10 +1001,9 @@ void CoreSessionEventProcessor::processIrcEvent353(IrcEvent *e) // See: http://ircv3.net/specs/extensions/multi-prefix-3.1.html while (e->network()->prefixes().contains(nick[0])) { // Mode found in 1 left-most character, add it to the list. - // FIXME Only allow one possible mode to avoid a warning in older clients - if (mode.isEmpty()) - mode.append(e->network()->prefixToMode(nick[0])); - //mode.append(e->network()->prefixToMode(nick[0])); + // Note: sending multiple modes may cause a warning in older clients. + // In testing, the clients still seemed to function fine. + mode.append(e->network()->prefixToMode(nick[0])); // Remove this mode from the nick nick = nick.remove(0, 1); } @@ -1266,7 +1279,7 @@ void CoreSessionEventProcessor::handleCtcpDcc(CtcpEvent *e) } // TODO: check if target is the right thing to use for the partner - CoreTransfer *transfer = new CoreTransfer(Transfer::Receive, e->target(), filename, address, port, size, this); + CoreTransfer *transfer = new CoreTransfer(Transfer::Direction::Receive, e->target(), filename, address, port, size, this); coreSession()->signalProxy()->synchronize(transfer); coreSession()->transferManager()->addTransfer(transfer); }