From feeadee893147181d0936ea8fc4765da9b54c7b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Wed, 4 Sep 2019 14:12:16 +0200 Subject: core/commands: remove more safeJID calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- poezio/core/commands.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/poezio/core/commands.py b/poezio/core/commands.py index 75949616..08e49898 100644 --- a/poezio/core/commands.py +++ b/poezio/core/commands.py @@ -857,8 +857,16 @@ class CommandCore: return self.help('invite') reason = args[2] - to = safeJID(args[0]) - room = safeJID(args[1]).bare + try: + to = JID(args[0]) + except InvalidJID: + self.core.information('Invalid JID specified for invite: %s' % args[0], 'Error') + return None + try: + room = JID(args[1]).bare + except InvalidJID: + self.core.information('Invalid room JID specified to invite: %s' % args[1], 'Error') + return None self.core.invite(to.full, room, reason=reason) self.core.information('Invited %s to %s' % (to.bare, room), 'Info') -- cgit v1.2.3