Don't allow messages from users we don't know

This commit is contained in:
Vgr E. Barry 2017-02-15 11:07:15 -05:00
parent 535d588c7b
commit 05b900ef57

View File

@ -246,12 +246,15 @@ class command:
@handle_error
def caller(self, cli, rawnick, chan, rest):
_ignore_locals_ = True
user = users._add(cli, nick=rawnick) # FIXME
user = users._get(rawnick, allow_none=True) # FIXME
if users.equals(chan, users.Bot.nick): # PM
target = users.Bot
else:
target = channels.add(chan, cli)
target = channels.get(chan, allow_none=True)
if user is None or target is None:
return
dispatcher = MessageDispatcher(user, target)