disco plugin: Add iq error reporting
Previously it behaved as if the response was empty, which was confusing.
This commit is contained in:
parent
f034f7d000
commit
25f15233e0
1 changed files with 4 additions and 0 deletions
|
@ -29,6 +29,10 @@ class Plugin(BasePlugin):
|
||||||
help='Get the disco#info of a JID')
|
help='Get the disco#info of a JID')
|
||||||
|
|
||||||
def on_disco(self, iq):
|
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']
|
info = iq['disco_info']
|
||||||
identities = (str(identity) for identity in info['identities'])
|
identities = (str(identity) for identity in info['identities'])
|
||||||
self.api.information('\n'.join(identities), 'Identities')
|
self.api.information('\n'.join(identities), 'Identities')
|
||||||
|
|
Loading…
Reference in a new issue