# HG changeset patch # User Goffi # Date 1665859113 -7200 # Node ID cd4d95b3fed3d52c57f5a008890ed58634bf364b # Parent 08c1d54854114d05774e8a620a24ec20614fcf64 plugin OXPS, XEP-0060: indicate which items were e2ee: the new `encryption` key is added to `getItems` metadata if items were e2ee, it contains a map from item ID to encryption metadata. rel 380 diff -r 08c1d5485411 -r cd4d95b3fed3 sat/plugins/plugin_sec_oxps.py --- a/sat/plugins/plugin_sec_oxps.py Sat Oct 15 20:38:33 2022 +0200 +++ b/sat/plugins/plugin_sec_oxps.py Sat Oct 15 20:38:33 2022 +0200 @@ -736,6 +736,7 @@ decrypted_elt = xml_tools.parse(decrypted) item.children.clear() item.addChild(decrypted_elt) + extra.setdefault("encrypted", {})[item["id"]] = {"type": NS_OXPS} async def _message_received_trigger( self, diff -r 08c1d5485411 -r cd4d95b3fed3 sat/plugins/plugin_xep_0060.py --- a/sat/plugins/plugin_xep_0060.py Sat Oct 15 20:38:33 2022 +0200 +++ b/sat/plugins/plugin_xep_0060.py Sat Oct 15 20:38:33 2022 +0200 @@ -854,6 +854,9 @@ # normally we have a strict equality here but XEP-0059 states # that index MAY be approximative, so just in caseā€¦ metadata["complete"] = index + len(items) >= count + # encrypted metadata can be added by plugins in XEP-0060_items trigger + if "encrypted" in extra: + metadata["encrypted"] = extra["encrypted"] return (items, metadata)