diff --git a/sat/plugins/plugin_xep_0277.py b/sat/plugins/plugin_xep_0277.py index 2f3d5fdf..2ea503a2 100644 --- a/sat/plugins/plugin_xep_0277.py +++ b/sat/plugins/plugin_xep_0277.py @@ -961,6 +961,8 @@ class XEP_0277(object): """ # TODO: check that all data keys are used, this would avoid sending publicly a private message # by accident (e.g. if group plugin is not loaded, and "group*" key are not used) + if service is None: + service = client.jid.userhostJID() if node is None: node = NS_MICROBLOG @@ -976,6 +978,12 @@ class XEP_0277(object): except error.StanzaError: log.warning("Can't create comments node for item {}".format(item_id)) item = await self.data2entry(client, data, item_id, service, node) + + if not await self.host.trigger.asyncPoint( + "XEP-0277_send", client, service, node, item, data + ): + return None + await self._p.publish(client, service, node, [item]) return item_id