Commit 0c8fe4da authored by louiz’'s avatar louiz’

Properly yield an error on /add without arguments

parent 03c2d297
......@@ -619,10 +619,13 @@ class RosterInfoTab(Tab):
Add the specified JID to the roster, and set automatically
accept the reverse subscription
jid = safeJID(safeJID(args[0]).bare)
if not jid:
if args is None:
self.core.information('No JID specified', 'Error')
jid = safeJID(safeJID(args[0]).bare)
if not str(jid):
self.core.information('The provided JID (%s) is not valid' % (args[0],), 'Error')
if jid in roster and roster[jid].subscription in ('to', 'both'):
return self.core.information('Already subscribed.', 'Roster')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment