summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tabs.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/tabs.py b/src/tabs.py
index c7e58e81..ef4f9803 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -1585,9 +1585,17 @@ class RosterInfoTab(Tab):
return
else:
jid = JID(args[0]).bare
+ if not jid in [contact.bare_jid for contact in roster.get_contacts()]:
+ self.core.information('No subscription to deny')
+ return
+
self.core.xmpp.sendPresence(pto=jid, ptype='unsubscribed')
- if self.core.xmpp.update_roster(jid, subscription='remove'):
- roster.remove_contact(jid)
+ try:
+ if self.core.xmpp.update_roster(jid, subscription='remove'):
+ roster.remove_contact(jid)
+ except Exception as e:
+ import traceback
+ log.debug(_('Traceback when removing %s from the roster:\n')+traceback.format_exc())
def command_add(self, args):
"""