summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0030/disco.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-12-28 11:46:13 -0500
committerLance Stout <lancestout@gmail.com>2011-12-28 11:46:13 -0500
commit4df1641689da53e3f9c2e49ee3f0e5e92a7c4d06 (patch)
treeb5249cdac2ae8752a569a862c52a17537968b834 /sleekxmpp/plugins/xep_0030/disco.py
parent5ef0b96d5c038d70fd563c18d592a4637106879b (diff)
downloadslixmpp-4df1641689da53e3f9c2e49ee3f0e5e92a7c4d06.tar.gz
slixmpp-4df1641689da53e3f9c2e49ee3f0e5e92a7c4d06.tar.bz2
slixmpp-4df1641689da53e3f9c2e49ee3f0e5e92a7c4d06.tar.xz
slixmpp-4df1641689da53e3f9c2e49ee3f0e5e92a7c4d06.zip
Add set_info disco handler.
Diffstat (limited to 'sleekxmpp/plugins/xep_0030/disco.py')
-rw-r--r--sleekxmpp/plugins/xep_0030/disco.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/sleekxmpp/plugins/xep_0030/disco.py b/sleekxmpp/plugins/xep_0030/disco.py
index e1eec706..ccfee8b8 100644
--- a/sleekxmpp/plugins/xep_0030/disco.py
+++ b/sleekxmpp/plugins/xep_0030/disco.py
@@ -111,12 +111,12 @@ class xep_0030(base_plugin):
self.use_cache = self.config.get('use_cache', True)
self.wrap_results = self.config.get('wrap_results', False)
- self._disco_ops = ['get_info', 'set_identities', 'set_features',
- 'get_items', 'set_items', 'del_items',
- 'add_identity', 'del_identity', 'add_feature',
- 'del_feature', 'add_item', 'del_item',
- 'del_identities', 'del_features',
- 'cache_info', 'get_cached_info']
+ self._disco_ops = [
+ 'get_info', 'set_info', 'set_identities', 'set_features',
+ 'get_items', 'set_items', 'del_items', 'add_identity',
+ 'del_identity', 'add_feature', 'del_feature', 'add_item',
+ 'del_item', 'del_identities', 'del_features', 'cache_info',
+ 'get_cached_info']
self.default_handlers = {}
self._handlers = {}
@@ -344,6 +344,15 @@ class xep_0030(base_plugin):
block=kwargs.get('block', True),
callback=kwargs.get('callback', None))
+ def set_info(self, jid=None, node=None, info=None):
+ """
+ Set the disco#info data for a JID/node based on an existing
+ disco#info stanza.
+ """
+ if isinstance(info, Iq):
+ info = info['disco_info']
+ self._run_node_handler('set_info', jid, node, None, info)
+
def get_items(self, jid=None, node=None, local=False, **kwargs):
"""
Retrieve the disco#items results from a given JID/node combination.