diff options
author | mathieui <mathieui@mathieui.net> | 2021-07-15 10:01:03 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2021-07-15 10:01:03 +0200 |
commit | 22fa8bc4d91d38a1176b09d03e0d41313b1adcaa (patch) | |
tree | 7344f9e7d72b913e9dfef29fe9b926364e7db587 /slixmpp/plugins/xep_0070/confirm.py | |
parent | b1411d8ed79792c6839f4aace13061256337e69b (diff) | |
parent | 5c54806578260adcb54b12b00a16cc8707a19263 (diff) | |
download | slixmpp-22fa8bc4d91d38a1176b09d03e0d41313b1adcaa.tar.gz slixmpp-22fa8bc4d91d38a1176b09d03e0d41313b1adcaa.tar.bz2 slixmpp-22fa8bc4d91d38a1176b09d03e0d41313b1adcaa.tar.xz slixmpp-22fa8bc4d91d38a1176b09d03e0d41313b1adcaa.zip |
Merge branch 'more-typing' into 'master'
Add more typing
See merge request poezio/slixmpp!166
Diffstat (limited to 'slixmpp/plugins/xep_0070/confirm.py')
-rw-r--r-- | slixmpp/plugins/xep_0070/confirm.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/slixmpp/plugins/xep_0070/confirm.py b/slixmpp/plugins/xep_0070/confirm.py index 334f78d4..1edde8d9 100644 --- a/slixmpp/plugins/xep_0070/confirm.py +++ b/slixmpp/plugins/xep_0070/confirm.py @@ -1,4 +1,3 @@ - # Slixmpp: The Slick XMPP Library # Copyright (C) 2015 Emmanuel Gil Peyrot # This file is part of Slixmpp. @@ -7,11 +6,10 @@ import asyncio import logging from uuid import uuid4 -from slixmpp.plugins import BasePlugin, register_plugin -from slixmpp import future_wrapper, Iq, Message -from slixmpp.exceptions import XMPPError, IqError, IqTimeout +from slixmpp.plugins import BasePlugin +from slixmpp import Iq, Message from slixmpp.jid import JID -from slixmpp.xmlstream import JID, register_stanza_plugin +from slixmpp.xmlstream import register_stanza_plugin from slixmpp.xmlstream.handler import Callback from slixmpp.xmlstream.matcher import StanzaPath from slixmpp.plugins.xep_0070 import stanza, Confirm @@ -52,7 +50,6 @@ class XEP_0070(BasePlugin): def session_bind(self, jid): self.xmpp['xep_0030'].add_feature('http://jabber.org/protocol/http-auth') - @future_wrapper def ask_confirm(self, jid, id, url, method, *, ifrom=None, message=None): jid = JID(jid) if jid.resource: @@ -70,7 +67,9 @@ class XEP_0070(BasePlugin): if message is not None: stanza['body'] = message.format(id=id, url=url, method=method) stanza.send() - return stanza + fut = asyncio.Future() + fut.set_result(stanza) + return fut else: return stanza.send() |