Simplify registering API handler defaults.

This commit is contained in:
Lance Stout 2012-04-03 10:58:31 -07:00
parent 4921c44d0a
commit e0dd9c3618
3 changed files with 3 additions and 6 deletions

View file

@ -119,8 +119,7 @@ class XEP_0030(BasePlugin):
'get_cached_info', 'supports', 'has_identity']
for op in self._disco_ops:
self.api.register(getattr(self.static, op), op)
self.api.register_default(getattr(self.static, op), op)
self.api.register(getattr(self.static, op), op, default=True)
def _add_disco_op(self, op, default_handler):
self.api.register(default_handler, op)

View file

@ -78,8 +78,7 @@ class XEP_0115(BasePlugin):
self.static = StaticCaps(self.xmpp, disco.static)
for op in self._disco_ops:
self.api.register(getattr(self.static, op), op)
self.api.register_default(getattr(self.static, op), op)
self.api.register(getattr(self.static, op), op, default=True)
self._run_node_handler = disco._run_node_handler

View file

@ -61,8 +61,7 @@ class XEP_0128(BasePlugin):
self.disco.del_extended_info = self.del_extended_info
for op in self._disco_ops:
self.api.register(getattr(self.static, op), op)
self.api.register_default(getattr(self.static, op), op)
self.api.register(getattr(self.static, op), op, default=True)
def set_extended_info(self, jid=None, node=None, **kwargs):
"""