Mercurial > libervia-backend
comparison 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 |
comparison
equal
deleted
inserted
replaced
3956:3cb9ade2ab84 | 3957:b8ab6da58ac8 |
---|---|
981 if not await self.host.trigger.asyncPoint( | 981 if not await self.host.trigger.asyncPoint( |
982 "XEP-0277_send", client, service, node, item, data | 982 "XEP-0277_send", client, service, node, item, data |
983 ): | 983 ): |
984 return None | 984 return None |
985 | 985 |
986 extra = {"encrypted": True} if data.get("encrypted") else None | 986 extra = {} |
987 for key in ("encrypted", "signed"): | |
988 value = data.get(key) | |
989 if value is not None: | |
990 extra[key] = value | |
987 | 991 |
988 await self._p.publish(client, service, node, [item], extra=extra) | 992 await self._p.publish(client, service, node, [item], extra=extra) |
989 return item_id | 993 return item_id |
990 | 994 |
991 def _mbRepeat( | 995 def _mbRepeat( |