From e691850a2b1831bdb63ef2254c41b4a481370858 Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 4 Oct 2016 19:26:03 +0200 Subject: [PATCH] Fix XEP-0128 Broken since 125336aeee6 due to unforeseen consequences of a variable removal. --- slixmpp/plugins/xep_0128/static.py | 29 +++++++++++++---------------- 1 file 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)