X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcoresessioneventprocessor.cpp;h=82da78174a0ebd4fb6a9eb629793c7b12030f0b5;hb=f64ac93b92faeb2fd8f9c411168e04e8501bd6e8;hp=0468d970b7e9e644bbe13c2928f64d3b5474c341;hpb=324ae188301d46e2268462bc0d8411baed8f00b8;p=quassel.git diff --git a/src/core/coresessioneventprocessor.cpp b/src/core/coresessioneventprocessor.cpp index 0468d970..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); + } + } } }