From 488f7ed88691d9f7fa756a28702f6bee43d6a260 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Fri, 30 Mar 2012 23:02:48 -0700 Subject: 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. --- sleekxmpp/plugins/xep_0128/extended_disco.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sleekxmpp/plugins/xep_0128') 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) -- cgit v1.2.3