plugin group blog: getItems for comments fixed when we are the publisher of the parent node
This commit is contained in:
parent
9a52e2a80c
commit
9bec52525b
1 changed files with 5 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue