diff sat/plugins/plugin_xep_0277.py @ 3957:b8ab6da58ac8

plugin XEP-0277: `signed` flag can now be used in `extra` to use sign the blog post: rel 381
author Goffi <goffi@goffi.org>
date Fri, 28 Oct 2022 18:47:17 +0200
parents f7ff893b536e
children 5fbdf986670c
line wrap: on
line diff
--- a/sat/plugins/plugin_xep_0277.py	Fri Oct 28 18:47:17 2022 +0200
+++ b/sat/plugins/plugin_xep_0277.py	Fri Oct 28 18:47:17 2022 +0200
@@ -983,7 +983,11 @@
         ):
             return None
 
-        extra = {"encrypted": True} if data.get("encrypted") else None
+        extra = {}
+        for key in ("encrypted", "signed"):
+            value = data.get(key)
+            if value is not None:
+                extra[key] = value
 
         await self._p.publish(client, service, node, [item], extra=extra)
         return item_id