comparison sat/plugins/plugin_xep_0346.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 909b56b115ff
children 524856bd7b19
comparison
equal deleted inserted replaced
3858:6e785662dd7d 3859:3ef988734869
370 extra, 370 extra,
371 ) 371 )
372 items, metadata = items_data 372 items, metadata = items_data
373 items_xmlui = [] 373 items_xmlui = []
374 for item_elt in items: 374 for item_elt in items:
375 for x_elt in item_elt.elements((data_form.NS_X_DATA, "x")): 375 for x_elt in item_elt.elements(data_form.NS_X_DATA, "x"):
376 form = data_form.Form.fromElement(x_elt) 376 form = data_form.Form.fromElement(x_elt)
377 if form_ns and form.formNamespace != form_ns: 377 if form_ns and form.formNamespace != form_ns:
378 log.debug( 378 log.debug(
379 f"form's namespace ({form.formNamespace!r}) differs from expected" 379 f"form's namespace ({form.formNamespace!r}) differs from expected"
380 f"{form_ns!r}" 380 f"{form_ns!r}"