Don't try to add new users if we're changing usermodes on ourselves.

The actor in this case will either be ourself (in which case users.Bot
already exists), or a services nick (which may not have a full hostmask,
and therefore cause hashing errors). Only try to add a user if we're
changing a channel mode. This may still break on chanmodes, needs more
testing in that regard.
This commit is contained in:
skizzerz 2018-01-05 13:04:42 -07:00
parent 08a81fbc09
commit 6d401fd461

View File

@ -316,11 +316,11 @@ def mode_change(cli, rawnick, chan, mode, *targets):
""" """
actor = users._add(cli, nick=rawnick) # FIXME
if chan == users.Bot.nick: # we only see user modes set to ourselves if chan == users.Bot.nick: # we only see user modes set to ourselves
users.Bot.modes.update(mode) users.Bot.modes.update(mode)
return return
actor = users._add(cli, nick=rawnick) # FIXME
target = channels.add(chan, cli) target = channels.add(chan, cli)
target.queue("mode_change", {"mode": mode, "targets": targets}, (var, actor, target)) target.queue("mode_change", {"mode": mode, "targets": targets}, (var, actor, target))