diff options
author | Lance Stout <lancestout@gmail.com> | 2010-11-18 01:12:11 -0500 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2010-11-18 01:12:11 -0500 |
commit | 9214dc6610c8892edacb889e5e10917538087538 (patch) | |
tree | c2da3cd821ae6c0eca41a34f08807cca9f88c1cd /sleekxmpp/plugins | |
parent | 58b95e4ae45432ae97bd643c591f4f078f29f300 (diff) | |
download | slixmpp-9214dc6610c8892edacb889e5e10917538087538.tar.gz slixmpp-9214dc6610c8892edacb889e5e10917538087538.tar.bz2 slixmpp-9214dc6610c8892edacb889e5e10917538087538.tar.xz slixmpp-9214dc6610c8892edacb889e5e10917538087538.zip |
Add rename_node method to disco plugin.
Diffstat (limited to 'sleekxmpp/plugins')
-rw-r--r-- | sleekxmpp/plugins/xep_0030.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sleekxmpp/plugins/xep_0030.py b/sleekxmpp/plugins/xep_0030.py index a3fac346..e3589077 100644 --- a/sleekxmpp/plugins/xep_0030.py +++ b/sleekxmpp/plugins/xep_0030.py @@ -224,6 +224,14 @@ class xep_0030(base.base_plugin): if node in self.nodes: del self.nodes[node] + def rename_node(self, node, new_name): + if new_name not in self.nodes and node in self.nodes: + self.nodes[new_name] = self.nodes[node] + self.nodes[new_name].name = new_name + self.nodes[new_name].info['node'] = new_name + self.nodes[new_name].items['node'] = new_name + self.del_node(node) + def handle_item_query(self, iq): if iq['type'] == 'get': log.debug("Items requested by %s" % iq['from']) |