summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-11-15 19:15:06 +0100
committermathieui <mathieui@mathieui.net>2011-11-15 19:15:06 +0100
commite8837e252fd4e0166342674575e3060ae34f9559 (patch)
tree139324baae9fe7f4fea2a48f5baa2d5a21e2593b /src
parent68aa832a4942cf274d639e2b8d6b15cd2ef585cc (diff)
downloadpoezio-e8837e252fd4e0166342674575e3060ae34f9559.tar.gz
poezio-e8837e252fd4e0166342674575e3060ae34f9559.tar.bz2
poezio-e8837e252fd4e0166342674575e3060ae34f9559.tar.xz
poezio-e8837e252fd4e0166342674575e3060ae34f9559.zip
Fixes #2292
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):
"""