diff libervia/backend/plugins/plugin_xep_0280.py @ 4153:9162d3480b9e

plugin XEP-0280: minor parsing improvement.
author Goffi <goffi@goffi.org>
date Wed, 22 Nov 2023 14:53:07 +0100
parents 4b842c1fb686
children e11b13418ba6
line wrap: on
line diff
--- a/libervia/backend/plugins/plugin_xep_0280.py	Wed Nov 22 14:52:00 2023 +0100
+++ b/libervia/backend/plugins/plugin_xep_0280.py	Wed Nov 22 14:53:07 2023 +0100
@@ -118,13 +118,11 @@
 
     def message_received_trigger(self, client, message_elt, post_treat):
         """get message and handle it if carbons namespace is present"""
-        carbons_elt = None
         for e in message_elt.elements():
-            if e.uri == NS_CARBONS:
+            if e.uri == NS_CARBONS and e.name in ("received", "sent"):
                 carbons_elt = e
                 break
-
-        if carbons_elt is None:
+        else:
             # this is not a message carbons,
             # we continue normal behaviour
             return True