From 8b9075e1f09984d8edb6cd09282fee7a1fa6a848 Mon Sep 17 00:00:00 2001 From: souliane Date: Tue, 1 Dec 2015 23:09:50 +0100 Subject: [PATCH] plugin XEP-0277: don't try to create a new comments node if it already exists --- src/plugins/plugin_xep_0277.py | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/plugins/plugin_xep_0277.py b/src/plugins/plugin_xep_0277.py index d1a91277..29741569 100755 --- a/src/plugins/plugin_xep_0277.py +++ b/src/plugins/plugin_xep_0277.py @@ -478,24 +478,16 @@ class XEP_0277(object): comments_node_base = u"{}{}".format(NS_COMMENT_PREFIX, item_id) comments_node = comments_node_base - - suffix = None comments_service = client.pubsub_service if client.pubsub_service is not None else service - # we try to create the comment nodes # - max_tries = 3 - - for i in xrange(max_tries+1): - try: - yield self._p.createNode(comments_service, comments_node, options, profile_key=profile) - break - except error.StanzaError as e: - if e.condition == 'conflict' and i