summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-10-23 19:30:35 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2017-10-23 18:53:44 +0100
commit9ba50cb7ed7210600fb84172746fdb58dc3b2e1e (patch)
tree3c9b2272973eecd5b1bd727f4aa837ddcc37a2a8
parentaf73b413eb8d143499c6f6d796aab5aa03efd75a (diff)
downloadpoezio-9ba50cb7ed7210600fb84172746fdb58dc3b2e1e.tar.gz
poezio-9ba50cb7ed7210600fb84172746fdb58dc3b2e1e.tar.bz2
poezio-9ba50cb7ed7210600fb84172746fdb58dc3b2e1e.tar.xz
poezio-9ba50cb7ed7210600fb84172746fdb58dc3b2e1e.zip
Include the JID blocked instead of "Contact"
It's useful to see what JID you blocked. Any JID can be blocked, so "Contact" isn't always accurate.
-rw-r--r--poezio/tabs/rostertab.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/poezio/tabs/rostertab.py b/poezio/tabs/rostertab.py
index e1a8f532..731120be 100644
--- a/poezio/tabs/rostertab.py
+++ b/poezio/tabs/rostertab.py
@@ -376,12 +376,6 @@ class RosterInfoTab(Tab):
"""
/block [jid]
"""
- def callback(iq):
- if iq['type'] == 'error':
- return self.core.information('Could not block the contact.', 'Error')
- elif iq['type'] == 'result':
- return self.core.information('Contact blocked.', 'Info')
-
item = self.roster_win.selected_row
if args:
jid = safeJID(args[0])
@@ -389,6 +383,13 @@ class RosterInfoTab(Tab):
jid = item.bare_jid
elif isinstance(item, Resource):
jid = item.jid.bare
+
+ def callback(iq):
+ if iq['type'] == 'error':
+ return self.core.information('Could not block %s.' % jid, 'Error')
+ elif iq['type'] == 'result':
+ return self.core.information('Blocked %s.' % jid, 'Info')
+
self.core.xmpp.plugin['xep_0191'].block(jid, callback=callback)
def completion_block(self, the_input):