comparison sat/plugins/plugin_sec_aesgcm.py @ 3859:3ef988734869

core: fix calls to `domish.Element.elements`: domish.Element.elements should be called with namespace and element name as 2 arguments, but it has been confused in several places with the call to `domish.Element.addElement` which is often done with a `(namespace, name)` tuple. Unfortunately calling with a tuple is accepted and doesn't raise any error in `elements`, but this result in a wrong element returned. This patch fixes the erroneous calls.
author Goffi <goffi@goffi.org>
date Wed, 20 Jul 2022 17:12:29 +0200
parents be6d91572633
children 0ff265725489
comparison
equal deleted inserted replaced
3858:6e785662dd7d 3859:3ef988734869
165 # we have a message, we must send first attachment separately 165 # we have a message, we must send first attachment separately
166 extra_attachments = attachments[:] 166 extra_attachments = attachments[:]
167 attachments.clear() 167 attachments.clear()
168 del data["extra"][C.MESS_KEY_ATTACHMENTS] 168 del data["extra"][C.MESS_KEY_ATTACHMENTS]
169 169
170 body_elt = next(data["xml"].elements((C.NS_CLIENT, "body"))) 170 body_elt = next(data["xml"].elements(C.NS_CLIENT, "body"))
171 171
172 for attachment in attachments: 172 for attachment in attachments:
173 body_elt.addContent(attachment["url"]) 173 body_elt.addContent(attachment["url"])
174 174
175 for attachment in extra_attachments: 175 for attachment in extra_attachments: