# HG changeset patch # User Goffi # Date 1657796130 -7200 # Node ID e9c380ef41c89eb6cb7dbd4db6c6b2f2d1dcdc0a # Parent aaa4e7815ba82eb9dd6b32982181d8075cd00187 plugin XEP-0277: return ID of published item in `send` and bridge's `mbSend` diff -r aaa4e7815ba8 -r e9c380ef41c8 sat/plugins/plugin_xep_0277.py --- a/sat/plugins/plugin_xep_0277.py Thu Jul 14 12:55:30 2022 +0200 +++ b/sat/plugins/plugin_xep_0277.py Thu Jul 14 12:55:30 2022 +0200 @@ -109,7 +109,7 @@ "mbSend", ".plugin", in_sign="ssss", - out_sign="", + out_sign="s", method=self._mbSend, async_=True, ) @@ -948,7 +948,7 @@ 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 @@ 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 @@ 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,