From aea64e7b87d12152ba01b3121fe042fc2ec4e446 Mon Sep 17 00:00:00 2001 From: Goffi Date: Thu, 6 Oct 2022 16:02:05 +0200 Subject: [PATCH] plugin XEP-0334: avoid adding twice the same hint: rel 379 --- sat/plugins/plugin_xep_0334.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sat/plugins/plugin_xep_0334.py b/sat/plugins/plugin_xep_0334.py index d1c3416f..571cdf55 100644 --- a/sat/plugins/plugin_xep_0334.py +++ b/sat/plugins/plugin_xep_0334.py @@ -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 ') def _sendPostXmlTreatment(self, mess_data): if "hints" in mess_data: