summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0128
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-03-30 23:02:48 -0700
committerLance Stout <lancestout@gmail.com>2012-04-06 15:09:25 -0400
commit488f7ed88691d9f7fa756a28702f6bee43d6a260 (patch)
tree62d59aef1051cd3ae0d068499e371efd5a6c6fdc /sleekxmpp/plugins/xep_0128
parent51e5aee8308e42a89b7c0ab83ec53e2abea9767f (diff)
downloadslixmpp-488f7ed88691d9f7fa756a28702f6bee43d6a260.tar.gz
slixmpp-488f7ed88691d9f7fa756a28702f6bee43d6a260.tar.bz2
slixmpp-488f7ed88691d9f7fa756a28702f6bee43d6a260.tar.xz
slixmpp-488f7ed88691d9f7fa756a28702f6bee43d6a260.zip
Begin experiment with a centralized API callback registry.
The API registry generalizes the node handler system from the xep_0030 plugin so that other plugins can use it.
Diffstat (limited to 'sleekxmpp/plugins/xep_0128')
-rw-r--r--sleekxmpp/plugins/xep_0128/extended_disco.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/sleekxmpp/plugins/xep_0128/extended_disco.py b/sleekxmpp/plugins/xep_0128/extended_disco.py
index d49741de..93f8e8f0 100644
--- a/sleekxmpp/plugins/xep_0128/extended_disco.py
+++ b/sleekxmpp/plugins/xep_0128/extended_disco.py
@@ -61,7 +61,8 @@ class XEP_0128(BasePlugin):
self.disco.del_extended_info = self.del_extended_info
for op in self._disco_ops:
- self.disco._add_disco_op(op, getattr(self.static, op))
+ self.api.register(getattr(self.static, op), op)
+ self.api.register_default(getattr(self.static, op), op)
def set_extended_info(self, jid=None, node=None, **kwargs):
"""
@@ -76,7 +77,7 @@ class XEP_0128(BasePlugin):
as extended information, replacing any
existing extensions.
"""
- self.disco._run_node_handler('set_extended_info', jid, node, None, kwargs)
+ self.api['set_extended_info'](jid, node, None, kwargs)
def add_extended_info(self, jid=None, node=None, **kwargs):
"""
@@ -88,7 +89,7 @@ class XEP_0128(BasePlugin):
data -- Either a form, or a list of forms to add
as extended information.
"""
- self.disco._run_node_handler('add_extended_info', jid, node, None, kwargs)
+ self.api['add_extended_info'](jid, node, None, kwargs)
def del_extended_info(self, jid=None, node=None, **kwargs):
"""
@@ -98,4 +99,4 @@ class XEP_0128(BasePlugin):
jid -- The JID to modify.
node -- The node to modify.
"""
- self.disco._run_node_handler('del_extended_info', jid, node, None, kwargs)
+ self.api['del_extended_info'](jid, node, None, kwargs)