summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2016-10-04 19:26:03 +0200
committermathieui <mathieui@mathieui.net>2016-10-04 19:26:03 +0200
commite691850a2b1831bdb63ef2254c41b4a481370858 (patch)
tree76773ba59d431f57088dbe797faf9a3e585762dd
parentd4bff8dee6ce6ed79b9b235b7a6ec36dbea234b9 (diff)
downloadslixmpp-e691850a2b1831bdb63ef2254c41b4a481370858.tar.gz
slixmpp-e691850a2b1831bdb63ef2254c41b4a481370858.tar.bz2
slixmpp-e691850a2b1831bdb63ef2254c41b4a481370858.tar.xz
slixmpp-e691850a2b1831bdb63ef2254c41b4a481370858.zip
Fix XEP-0128
Broken since 125336aeee6 due to unforeseen consequences of a variable removal.
-rw-r--r--slixmpp/plugins/xep_0128/static.py29
1 files changed, 13 insertions, 16 deletions
diff --git a/slixmpp/plugins/xep_0128/static.py b/slixmpp/plugins/xep_0128/static.py
index ab1ea590..27bcb056 100644
--- a/slixmpp/plugins/xep_0128/static.py
+++ b/slixmpp/plugins/xep_0128/static.py
@@ -38,9 +38,8 @@ class StaticExtendedDisco(object):
The data parameter may provide:
data -- Either a single data form, or a list of data forms.
"""
- with self.static.lock:
- self.del_extended_info(jid, node, ifrom, data)
- self.add_extended_info(jid, node, ifrom, data)
+ self.del_extended_info(jid, node, ifrom, data)
+ self.add_extended_info(jid, node, ifrom, data)
def add_extended_info(self, jid, node, ifrom, data):
"""
@@ -49,16 +48,15 @@ class StaticExtendedDisco(object):
The data parameter may provide:
data -- Either a single data form, or a list of data forms.
"""
- with self.static.lock:
- self.static.add_node(jid, node)
+ self.static.add_node(jid, node)
- forms = data.get('data', [])
- if not isinstance(forms, list):
- forms = [forms]
+ forms = data.get('data', [])
+ if not isinstance(forms, list):
+ forms = [forms]
- info = self.static.get_node(jid, node)['info']
- for form in forms:
- info.append(form)
+ info = self.static.get_node(jid, node)['info']
+ for form in forms:
+ info.append(form)
def del_extended_info(self, jid, node, ifrom, data):
"""
@@ -66,8 +64,7 @@ class StaticExtendedDisco(object):
The data parameter is not used.
"""
- with self.static.lock:
- if self.static.node_exists(jid, node):
- info = self.static.get_node(jid, node)['info']
- for form in info['substanza']:
- info.xml.remove(form.xml)
+ if self.static.node_exists(jid, node):
+ info = self.static.get_node(jid, node)['info']
+ for form in info['substanza']:
+ info.xml.remove(form.xml)