# HG changeset patch # User Goffi # Date 1371401342 -7200 # Node ID 8782f94e761eb09b4ec228b5de0def0b76a9f2e4 # Parent 6f4c31192c7ce56624872bd9de040ef14658e5a4 plugin groupblog: comment item is specified through microblog data, there is no more a specific signal type diff -r 6f4c31192c7c -r 8782f94e761e src/plugins/plugin_misc_groupblog.py --- a/src/plugins/plugin_misc_groupblog.py Mon May 20 23:21:29 2013 +0200 +++ b/src/plugins/plugin_misc_groupblog.py Sun Jun 16 18:49:02 2013 +0200 @@ -182,12 +182,12 @@ 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 @@ 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 @@ # 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