From 6d401fd461834675f18d239f3f93c6e709ebbbdc Mon Sep 17 00:00:00 2001 From: skizzerz Date: Fri, 5 Jan 2018 13:04:42 -0700 Subject: [PATCH] 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. --- src/hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks.py b/src/hooks.py index a21e492..35cd9a5 100644 --- a/src/hooks.py +++ b/src/hooks.py @@ -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 users.Bot.modes.update(mode) return + actor = users._add(cli, nick=rawnick) # FIXME target = channels.add(chan, cli) target.queue("mode_change", {"mode": mode, "targets": targets}, (var, actor, target))