mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-24 03:00:15 +00:00
Add rename_node method to disco plugin.
This commit is contained in:
parent
58b95e4ae4
commit
9214dc6610
1 changed files with 8 additions and 0 deletions
|
@ -224,6 +224,14 @@ class xep_0030(base.base_plugin):
|
||||||
if node in self.nodes:
|
if node in self.nodes:
|
||||||
del self.nodes[node]
|
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):
|
def handle_item_query(self, iq):
|
||||||
if iq['type'] == 'get':
|
if iq['type'] == 'get':
|
||||||
log.debug("Items requested by %s" % iq['from'])
|
log.debug("Items requested by %s" % iq['from'])
|
||||||
|
|
Loading…
Reference in a new issue