# HG changeset patch # User Goffi # Date 1371470111 -7200 # Node ID 1de01a2154e22e1ea6a8b848b0f0e0a47424f8a9 # Parent e2c33a16d235f1230105ae03bd8b83834a3b9c00 plugin group blog: getItems for comments fixed when we are the publisher of the parent node diff -r e2c33a16d235 -r 1de01a2154e2 src/plugins/plugin_misc_groupblog.py --- a/src/plugins/plugin_misc_groupblog.py Mon Jun 17 13:30:57 2013 +0200 +++ b/src/plugins/plugin_misc_groupblog.py Mon Jun 17 13:55:11 2013 +0200 @@ -352,11 +352,12 @@ 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)