From 05b900ef57bd5ecdf568943a0f093dcc3fb02657 Mon Sep 17 00:00:00 2001 From: "Vgr E. Barry" Date: Wed, 15 Feb 2017 11:07:15 -0500 Subject: [PATCH] Don't allow messages from users we don't know --- src/decorators.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/decorators.py b/src/decorators.py index 2569ec1..aa569b4 100644 --- a/src/decorators.py +++ b/src/decorators.py @@ -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)