From d55cc5872503567775f0d7a7731d6f489bf2299b Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 12 Nov 2017 15:03:09 +0100 Subject: yapf -ir --- poezio/fixes.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'poezio/fixes.py') diff --git a/poezio/fixes.py b/poezio/fixes.py index 1eadac12..77688bf8 100644 --- a/poezio/fixes.py +++ b/poezio/fixes.py @@ -12,6 +12,7 @@ import logging log = logging.getLogger(__name__) + def has_identity(xmpp, jid, identity, on_true=None, on_false=None): def _cb(iq): ident = lambda x: x[0] @@ -20,8 +21,10 @@ def has_identity(xmpp, jid, identity, on_true=None, on_false=None): on_true() if not res and on_false is not None: on_false() + 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': @@ -31,6 +34,7 @@ def get_version(xmpp, jid, callback=None, **kwargs): 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) @@ -42,7 +46,8 @@ def get_room_form(xmpp, room, callback): def _cb(result): if result["type"] == "error": return callback(None) - xform = result.xml.find('{http://jabber.org/protocol/muc#owner}query/{jabber:x:data}x') + xform = result.xml.find( + '{http://jabber.org/protocol/muc#owner}query/{jabber:x:data}x') if xform is None: return callback(None) form = xmpp.plugin['xep_0004'].build_form(xform) @@ -53,6 +58,7 @@ def get_room_form(xmpp, room, callback): iq.append(query) iq.send(callback=_cb) + def _filter_add_receipt_request(self, stanza): """ Auto add receipt requests to outgoing messages, if: @@ -94,4 +100,3 @@ def _filter_add_receipt_request(self, stanza): stanza['request_receipt'] = True return stanza - -- cgit v1.2.3