diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-03-14 17:18:46 +0100 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-03-14 17:18:46 +0100 |
commit | 326de0f16155dc8a5729bffe0057282c3232141b (patch) | |
tree | bfd474a5395c7e5b317ace20d12411ea74046c3c /poezio/fixes.py | |
parent | ae172f84ddb9ff9c2fc26dd5ee16c1edd38d08ba (diff) | |
download | poezio-326de0f16155dc8a5729bffe0057282c3232141b.tar.gz poezio-326de0f16155dc8a5729bffe0057282c3232141b.tar.bz2 poezio-326de0f16155dc8a5729bffe0057282c3232141b.tar.xz poezio-326de0f16155dc8a5729bffe0057282c3232141b.zip |
Factorise the /version callback and make it handle errors
Fixes #3376.
Diffstat (limited to 'poezio/fixes.py')
-rw-r--r-- | poezio/fixes.py | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/poezio/fixes.py b/poezio/fixes.py index 77688bf8..f8de7b14 100644 --- a/poezio/fixes.py +++ b/poezio/fixes.py @@ -25,23 +25,6 @@ def has_identity(xmpp, jid, identity, on_true=None, on_false=None): xmpp.plugin['xep_0030'].get_info(jid=jid, callback=_cb) -def get_version(xmpp, jid, callback=None, **kwargs): - def handle_result(res): - if res and res['type'] != 'error': - ret = res['software_version'].values - else: - ret = False - if callback: - callback(ret) - return ret - - iq = xmpp.make_iq_get(ito=jid) - iq['query'] = 'jabber:iq:version' - result = iq.send(callback=handle_result if callback else None) - if not callback: - return handle_result(result) - - def get_room_form(xmpp, room, callback): def _cb(result): if result["type"] == "error": |