plugin groupblog: comment item is specified through microblog data, there is no more a specific signal type
This commit is contained in:
parent
c1b5ccf1d2
commit
c9d23dd32b
1 changed files with 8 additions and 7 deletions
|
|
@ -182,12 +182,12 @@ class GroupBlog(object):
|
|||
publisher = "" # FIXME: publisher attribute for item in SàT pubsub is not managed yet, so
|
||||
# publisher is not checked and can be easily spoofed. This need to be fixed
|
||||
# quickly.
|
||||
microblog_data = self.item2gbdata(item)
|
||||
microblog_data["comments_service"] = event.sender.userhost()
|
||||
microblog_data["comments_node"] = event.nodeIdentifier
|
||||
microblog_data = self.item2gbdata(item, "comment")
|
||||
microblog_data["service"] = event.sender.userhost()
|
||||
microblog_data["node"] = event.nodeIdentifier
|
||||
microblog_data["verified_publisher"] = "true" if publisher else "false"
|
||||
|
||||
self.host.bridge.personalEvent(publisher.full() if publisher else microblog_data["author"], "MICROBLOG_COMMENT", microblog_data, profile)
|
||||
self.host.bridge.personalEvent(publisher.full() if publisher else microblog_data["author"], "MICROBLOG", microblog_data, profile)
|
||||
return False
|
||||
return True
|
||||
|
||||
|
|
@ -208,9 +208,10 @@ class GroupBlog(object):
|
|||
|
||||
break
|
||||
|
||||
def item2gbdata(self, item):
|
||||
def item2gbdata(self, item, _type="main_item"):
|
||||
""" Convert item to microblog data dictionary + add access data """
|
||||
microblog_data = self.host.plugins["XEP-0277"].item2mbdata(item)
|
||||
microblog_data["type"] = _type
|
||||
self._parseAccessData(microblog_data, item)
|
||||
return microblog_data
|
||||
|
||||
|
|
@ -340,9 +341,9 @@ class GroupBlog(object):
|
|||
# if there is a comments node, we subscribe to it
|
||||
if "comments_node" in gbdata and pub_jid.userhostJID() != client.jid.userhostJID():
|
||||
try:
|
||||
self.host.plugins["XEP-0060"].subscribe(gbdata["comments_service"], gbdata["comments_node"],
|
||||
self.host.plugins["XEP-0060"].subscribe(jid.JID(gbdata["comments_service"]), gbdata["comments_node"],
|
||||
profile_key=client.profile)
|
||||
self.host.plugins["XEP-0060"].getItems(gbdata["comments_service"], gbdata["comments_node"], profile_key=client.profile)
|
||||
self.host.plugins["XEP-0060"].getItems(jid.JID(gbdata["comments_service"]), gbdata["comments_node"], profile_key=client.profile)
|
||||
except KeyError:
|
||||
warning("Missing key for comments")
|
||||
return ret
|
||||
|
|
|
|||
Loading…
Reference in a new issue