plugin XEP-0334: avoid adding twice the same hint:

rel 379
This commit is contained in:
Goffi 2022-10-06 16:02:05 +02:00
commit aea64e7b87

View file

@ -92,7 +92,10 @@ class XEP_0334(object):
@param hints: hints to add
"""
for hint in hints:
message_elt.addElement((NS_HINTS, hint))
if not list(message_elt.elements(NS_HINTS, hint)):
message_elt.addElement((NS_HINTS, hint))
else:
log.debug('Not adding {hint!r} hint: it is already present in <message>')
def _sendPostXmlTreatment(self, mess_data):
if "hints" in mess_data: