+ 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);
+ }
+ }