changeset 4153:9162d3480b9e

plugin XEP-0280: minor parsing improvement.
author Goffi <goffi@goffi.org>
date Wed, 22 Nov 2023 14:53:07 +0100 (13 months ago)
parents 23d21daed216
children 85f5e6225aa1
files libervia/backend/plugins/plugin_xep_0280.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
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