Commit 9ba50cb7 authored by Kim Alvefur's avatar Kim Alvefur Committed by Link Mauve

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.
parent af73b413
......@@ -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):
......
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