From b6b218943365231d84dd935a9d38ed3a495416dc Mon Sep 17 00:00:00 2001 From: Goffi Date: Thu, 16 Mar 2023 16:43:47 +0100 Subject: [PATCH] plugin XEP-0277: when publisher is not found, check ancestor in both client and component namespaces --- sat/core/constants.py | 2 ++ sat/plugins/plugin_xep_0277.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sat/core/constants.py b/sat/core/constants.py index ccbe00b4..8709e3ec 100644 --- a/sat/core/constants.py +++ b/sat/core/constants.py @@ -158,6 +158,8 @@ class Const(object): ## Common namespaces ## NS_XML = "http://www.w3.org/XML/1998/namespace" NS_CLIENT = "jabber:client" + NS_COMPONENT = "jabber:component:accept" + NS_STREAM = (NS_CLIENT, NS_COMPONENT) NS_FORWARD = "urn:xmpp:forward:0" NS_DELAY = "urn:xmpp:delay" NS_XHTML = "http://www.w3.org/1999/xhtml" diff --git a/sat/plugins/plugin_xep_0277.py b/sat/plugins/plugin_xep_0277.py index 821690f9..a0c1b64e 100644 --- a/sat/plugins/plugin_xep_0277.py +++ b/sat/plugins/plugin_xep_0277.py @@ -575,7 +575,7 @@ class XEP_0277(object): microblog_data["author_jid"] = publisher microblog_data["author_jid_verified"] = True else: - iq_elt = xml_tools.findAncestor(item_elt, "iq", C.NS_CLIENT) + iq_elt = xml_tools.findAncestor(item_elt, "iq", C.NS_STREAM) microblog_data["author_jid"] = iq_elt["from"] microblog_data["author_jid_verified"] = False