summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2019-09-04 14:12:16 +0200
committerMaxime “pep” Buquet <pep@bouah.net>2019-09-04 14:12:16 +0200
commitfeeadee893147181d0936ea8fc4765da9b54c7b0 (patch)
tree20446cb6c13a35be9eb2cf11493e4d29331f5fb7
parent04677b2116df5039b2e47a8f633c579e78d934b7 (diff)
downloadpoezio-feeadee893147181d0936ea8fc4765da9b54c7b0.tar.gz
poezio-feeadee893147181d0936ea8fc4765da9b54c7b0.tar.bz2
poezio-feeadee893147181d0936ea8fc4765da9b54c7b0.tar.xz
poezio-feeadee893147181d0936ea8fc4765da9b54c7b0.zip
core/commands: remove more safeJID calls
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--poezio/core/commands.py12
1 files 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')