changeset 3854:8a2c46122a11

plugin XEP-0060: fix bad naming of return variable
author Goffi <goffi@goffi.org>
date Thu, 14 Jul 2022 12:55:30 +0200
parents a56d5ad466b3
children 54305ebf5b94
files sat/plugins/plugin_pubsub_cache.py sat/plugins/plugin_xep_0060.py
diffstat 2 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/sat/plugins/plugin_pubsub_cache.py	Thu Jul 14 12:55:30 2022 +0200
+++ b/sat/plugins/plugin_pubsub_cache.py	Thu Jul 14 12:55:30 2022 +0200
@@ -280,7 +280,8 @@
             except error.StanzaError as e:
                 if e.condition == "service-unavailable":
                     log.warning(
-                        "service is hidding disco infos, we'll only cache latest 20 items"
+                        "service {service} is hidding disco infos, we'll only cache "
+                        "latest 20 items"
                     )
                     items, __ = await client.pubsub_client.items(
                         pubsub_node.service, pubsub_node.name, maxItems=20
--- a/sat/plugins/plugin_xep_0060.py	Thu Jul 14 12:55:30 2022 +0200
+++ b/sat/plugins/plugin_xep_0060.py	Thu Jul 14 12:55:30 2022 +0200
@@ -633,8 +633,10 @@
             else:
                 raise e
         try:
-            return [item['id']
-                for item in iq_result.pubsub.publish.elements(pubsub.NS_PUBSUB, 'item')]
+            return [
+                item['id']
+                for item in iq_result.pubsub.publish.elements(pubsub.NS_PUBSUB, 'item')
+            ]
         except AttributeError:
             return []
 
@@ -645,17 +647,21 @@
         nodeIdentifier: str,
         items: Optional[List[domish.Element]] = None,
         options: Optional[dict] = None
-    ) -> List[str]:
-        published_ids = await client.pubsub_client.publish(
+    ) -> domish.Element:
+        """Publish pubsub items
+
+        @return: IQ result stanza
+        """
+        iq_result_elt = await client.pubsub_client.publish(
             service, nodeIdentifier, items, client.pubsub_client.parent.jid,
             options=options
         )
 
         await self.host.trigger.asyncPoint(
             "XEP-0060_publish", client, service, nodeIdentifier, items, options,
-            published_ids
+            iq_result_elt
         )
-        return published_ids
+        return iq_result_elt
 
     def _unwrapMAMMessage(self, message_elt):
         try: