Properly yield an error on /add without arguments
This commit is contained in:
parent
03c2d2974a
commit
0c8fe4da30
1 changed files with 5 additions and 2 deletions
|
@ -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')
|
||||
return
|
||||
jid = safeJID(safeJID(args[0]).bare)
|
||||
if not str(jid):
|
||||
self.core.information('The provided JID (%s) is not valid' % (args[0],), 'Error')
|
||||
return
|
||||
if jid in roster and roster[jid].subscription in ('to', 'both'):
|
||||
return self.core.information('Already subscribed.', 'Roster')
|
||||
roster.add(jid)
|
||||
|
|
Loading…
Reference in a new issue