From db7fb10e9593fae16db38435139ab56877431d80 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Thu, 18 Nov 2010 01:15:34 -0500 Subject: [PATCH] Add rename_node method to disco plugin. --- sleekxmpp/plugins/xep_0030.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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'])