comparison libervia/backend/plugins/plugin_xep_0391.py @ 4223:919bdf7768d8

plugin XEP-0391: remove the need to have a OLDMEMO session started to decrypt: It should not be mandatory to have an OLDMEMO session started to decrypt JET files, and this was actually making a test failing.
author Goffi <goffi@goffi.org>
date Tue, 05 Mar 2024 17:31:56 +0100
parents 1b5cf2ee1d86
children e11b13418ba6
comparison
equal deleted inserted replaced
4222:1c30d574df2b 4223:919bdf7768d8
155 client: SatXMPPEntity, 155 client: SatXMPPEntity,
156 session: Dict[str, Any], 156 session: Dict[str, Any],
157 iq_elt: domish.Element, 157 iq_elt: domish.Element,
158 jingle_elt: domish.Element 158 jingle_elt: domish.Element
159 ) -> bool: 159 ) -> bool:
160 if client.encryption.get_namespace(
161 session["peer_jid"].userhostJID()
162 ) != self._o.NS_OLDMEMO:
163 return True
164 for content_elt in jingle_elt.elements(self._j.namespace, "content"): 160 for content_elt in jingle_elt.elements(self._j.namespace, "content"):
165 content_data = session["contents"][content_elt["name"]] 161 content_data = session["contents"][content_elt["name"]]
166 security_elt = next(content_elt.elements(NS_JET, "security"), None) 162 security_elt = next(content_elt.elements(NS_JET, "security"), None)
167 if security_elt is None: 163 if security_elt is None:
168 continue 164 continue