Commit 25f15233 authored by Kim Alvefur's avatar Kim Alvefur Committed by Maxime Buquet

disco plugin: Add iq error reporting

Previously it behaved as if the response was empty, which was confusing.
parent f034f7d0
Pipeline #1850 passed with stages
in 3 minutes and 7 seconds
......@@ -29,6 +29,10 @@ class Plugin(BasePlugin):
help='Get the disco#info of a JID')
def on_disco(self, iq):
if iq['type'] == 'error':
self.api.information(iq['error']['text'] or iq['error']['condition'], 'Error')
return
info = iq['disco_info']
identities = (str(identity) for identity in info['identities'])
self.api.information('\n'.join(identities), 'Identities')
......
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