From 2e638b26fc103de1a0de87a44ab642e5dc661c82 Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 22 Nov 2023 14:53:07 +0100 Subject: [PATCH] plugin XEP-0280: minor parsing improvement. --- libervia/backend/plugins/plugin_xep_0280.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libervia/backend/plugins/plugin_xep_0280.py b/libervia/backend/plugins/plugin_xep_0280.py index 7495947a..775a63f1 100644 --- a/libervia/backend/plugins/plugin_xep_0280.py +++ b/libervia/backend/plugins/plugin_xep_0280.py @@ -118,13 +118,11 @@ class XEP_0280(object): 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