From 9bec52525b019439d20afea7f498372adf124499 Mon Sep 17 00:00:00 2001 From: Goffi Date: Mon, 17 Jun 2013 13:55:11 +0200 Subject: [PATCH] plugin group blog: getItems for comments fixed when we are the publisher of the parent node --- src/plugins/plugin_misc_groupblog.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/plugin_misc_groupblog.py b/src/plugins/plugin_misc_groupblog.py index 72121962..c3f851e0 100755 --- a/src/plugins/plugin_misc_groupblog.py +++ b/src/plugins/plugin_misc_groupblog.py @@ -352,11 +352,12 @@ class GroupBlog(object): gbdata = self.item2gbdata(item) ret.append(gbdata) # if there is a comments node, we subscribe to it - if "comments_node" in gbdata and pub_jid.userhostJID() != client.jid.userhostJID(): + if "comments_node" in gbdata: try: - # every comments node must be subscribed - self.host.plugins["XEP-0060"].subscribe(jid.JID(gbdata["comments_service"]), gbdata["comments_node"], - profile_key=client.profile) + # every comments node must be subscribed, except if we are the publisher (we are already subscribed in this case) + if pub_jid.userhostJID() != client.jid.userhostJID(): + self.host.plugins["XEP-0060"].subscribe(jid.JID(gbdata["comments_service"]), gbdata["comments_node"], + profile_key=client.profile) # we get all comments of the node, and handle them defer_getItems = self.host.plugins["XEP-0060"].getItems(jid.JID(gbdata["comments_service"]), gbdata["comments_node"], profile_key=client.profile) defer_getItems.addCallback(self._handleCommentsItems, jid.JID(gbdata["comments_service"]), gbdata["comments_node"], client.profile)