summaryrefslogtreecommitdiff
path: root/slixmpp/plugins/xep_0128
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-02-14 11:57:25 +0100
committermathieui <mathieui@mathieui.net>2021-02-26 00:08:56 +0100
commite24e2f58d4e9c71ef005a4dfe88abac7bff1cc6b (patch)
tree9b804a68234e0d573adcec31102d63248c7088ee /slixmpp/plugins/xep_0128
parent4960cffcb49ce9b996b820103e48702d694239a1 (diff)
downloadslixmpp-e24e2f58d4e9c71ef005a4dfe88abac7bff1cc6b.tar.gz
slixmpp-e24e2f58d4e9c71ef005a4dfe88abac7bff1cc6b.tar.bz2
slixmpp-e24e2f58d4e9c71ef005a4dfe88abac7bff1cc6b.tar.xz
slixmpp-e24e2f58d4e9c71ef005a4dfe88abac7bff1cc6b.zip
XEP-0128: API changes
- ``set_extended_info``, ``add_extended_info`` and ``del_extended_info`` return Futures.
Diffstat (limited to 'slixmpp/plugins/xep_0128')
-rw-r--r--slixmpp/plugins/xep_0128/extended_disco.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/slixmpp/plugins/xep_0128/extended_disco.py b/slixmpp/plugins/xep_0128/extended_disco.py
index d0264caf..759e5efe 100644
--- a/slixmpp/plugins/xep_0128/extended_disco.py
+++ b/slixmpp/plugins/xep_0128/extended_disco.py
@@ -5,6 +5,7 @@
# See the file LICENSE for copying permission.
import logging
+from asyncio import Future
from typing import Optional
import slixmpp
@@ -53,37 +54,46 @@ class XEP_0128(BasePlugin):
for op in self._disco_ops:
self.api.register(getattr(self.static, op), op, default=True)
- def set_extended_info(self, jid=None, node=None, **kwargs):
+ def set_extended_info(self, jid=None, node=None, **kwargs) -> Future:
"""
Set additional, extended identity information to a node.
Replaces any existing extended information.
+ .. versionchanged:: 1.8.0
+ This function now returns a Future.
+
:param jid: The JID to modify.
:param node: The node to modify.
:param data: Either a form, or a list of forms to use
as extended information, replacing any
existing extensions.
"""
- self.api['set_extended_info'](jid, node, None, kwargs)
+ return self.api['set_extended_info'](jid, node, None, kwargs)
- def add_extended_info(self, jid=None, node=None, **kwargs):
+ def add_extended_info(self, jid=None, node=None, **kwargs) -> Future:
"""
Add additional, extended identity information to a node.
+ .. versionchanged:: 1.8.0
+ This function now returns a Future.
+
:param jid: The JID to modify.
:param node: The node to modify.
:param data: Either a form, or a list of forms to add
as extended information.
"""
- self.api['add_extended_info'](jid, node, None, kwargs)
+ return self.api['add_extended_info'](jid, node, None, kwargs)
def del_extended_info(self, jid: Optional[JID] = None,
- node: Optional[str] = None, **kwargs):
+ node: Optional[str] = None, **kwargs) -> Future:
"""
Remove all extended identity information to a node.
+ .. versionchanged:: 1.8.0
+ This function now returns a Future.
+
:param jid: The JID to modify.
:param node: The node to modify.
"""
- self.api['del_extended_info'](jid, node, None, kwargs)
+ return self.api['del_extended_info'](jid, node, None, kwargs)