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