diff --git a/sat/plugins/plugin_xep_0277.py b/sat/plugins/plugin_xep_0277.py index 1e40898a..2f3d5fdf 100644 --- a/sat/plugins/plugin_xep_0277.py +++ b/sat/plugins/plugin_xep_0277.py @@ -109,7 +109,7 @@ class XEP_0277(object): "mbSend", ".plugin", in_sign="ssss", - out_sign="", + out_sign="s", method=self._mbSend, async_=True, ) @@ -948,7 +948,7 @@ class XEP_0277(object): data: dict, service: Optional[jid.JID] = None, node: Optional[str] = NS_MICROBLOG - ) -> None: + ) -> Optional[str]: """Send XEP-0277's microblog data @param data: microblog data (must include at least a "content" or a "title" key). @@ -957,6 +957,7 @@ class XEP_0277(object): None to publish on profile's PEP @param node: PubSub node to use (defaut to microblog NS) None is equivalend as using default value + @return: ID of the published item """ # 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) @@ -975,7 +976,8 @@ 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) - return await self._p.publish(client, service, node, [item]) + await self._p.publish(client, service, node, [item]) + return item_id def _mbRepeat( self,