// If you wonder why there is no counterpart to ircUserJoined:
// the joins are propagated by the ircuser. The signal ircUserJoined is only for convenience
- // Also update the IRC user's record of modes; this allows easier tracking
- ircuser->addUserModes(modes[i]);
-
newNicks << ircuser->nick();
newModes << modes[i];
newUsers << ircuser;
if (!_userModes[ircuser].contains(mode)) {
_userModes[ircuser] += mode;
- // Also update the IRC user's record of modes; this allows easier tracking
- ircuser->addUserModes(mode);
QString nick = ircuser->nick();
SYNC_OTHER(addUserMode, ARG(nick), ARG(mode))
emit ircUserModeAdded(ircuser, mode);
if (_userModes[ircuser].contains(mode)) {
_userModes[ircuser].remove(mode);
- // Also update the IRC user's record of modes; this allows easier tracking
- ircuser->removeUserModes(mode);
QString nick = ircuser->nick();
SYNC_OTHER(removeUserMode, ARG(nick), ARG(mode));
emit ircUserModeRemoved(ircuser, mode);
/**
* Checks if a given capability is enabled.
*
+ * @param[in] capability Name of capability
* @returns True if enabled, otherwise false
*/
inline bool capEnabled(const QString &capability) const { return _capsSupported.contains(capability); }
/**
* Gets the value of an enabled or pending capability, e.g. sasl=plain.
*
+ * @param[in] capability Name of capability
* @returns Value of capability if one was specified, otherwise empty string
*/
QString capValue(const QString &capability) const;
// 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);
+ }
+ }
}
}