diff --git a/libervia/backend/core/xmpp.py b/libervia/backend/core/xmpp.py
index a5228dd4..49a02452 100644
--- a/libervia/backend/core/xmpp.py
+++ b/libervia/backend/core/xmpp.py
@@ -690,7 +690,7 @@ class SatXMPPEntity(core_types.SatXMPPEntity):
"""
raise NotImplementedError
- async def a_send(self, obj):
+ async def a_send(self, obj: domish.Element) -> None:
# original send method accept string
# but we restrict to domish.Element to make trigger treatments easier
assert isinstance(obj, domish.Element)
@@ -704,7 +704,7 @@ class SatXMPPEntity(core_types.SatXMPPEntity):
return
super().send(obj)
- def send(self, obj):
+ def send(self, obj: domish.Element):
defer.ensureDeferred(self.a_send(obj))
async def send_message_data(self, mess_data):
@@ -1151,6 +1151,12 @@ class SatXMPPComponent(SatXMPPEntity, component.Component):
def is_admin(self) -> bool:
return False
+ def is_local(self, jid_: jid.JID) -> bool:
+ """Returns True if jid_ use a domain or subdomain of component's host"""
+ local_host = self.host.split(".")
+ assert local_host
+ return jid_.host.split(".")[-len(local_host) :] == local_host
+
def _create_sub_protocols(self):
self.messageProt = SatMessageProtocol(self.host_app)
self.messageProt.setHandlerParent(self)
@@ -1310,7 +1316,7 @@ class SatMessageProtocol(xmppim.MessageProtocol):
@return(dict): message data
"""
if message_elt.name != "message":
- log.warning(
+ log.error(
_(
"parse_message used with a non stanza, ignoring: {xml}".format(
xml=message_elt.toXml()
@@ -1323,7 +1329,7 @@ class SatMessageProtocol(xmppim.MessageProtocol):
# xmlns may be None when wokkel element parsing strip out root namespace
self.normalize_ns(message_elt, None)
elif message_elt.uri != C.NS_CLIENT:
- log.warning(
+ log.error(
_(
"received with a wrong namespace: {xml}".format(
xml=message_elt.toXml()
diff --git a/libervia/backend/plugins/plugin_comp_ap_gateway/__init__.py b/libervia/backend/plugins/plugin_comp_ap_gateway/__init__.py
index f60f6d9b..24d7a59e 100644
--- a/libervia/backend/plugins/plugin_comp_ap_gateway/__init__.py
+++ b/libervia/backend/plugins/plugin_comp_ap_gateway/__init__.py
@@ -764,9 +764,10 @@ class APGateway:
def is_local(self, jid_: jid.JID) -> bool:
"""Returns True if jid_ use a domain or subdomain of gateway's host"""
- local_host = self.client.host.split(".")
- assert local_host
- return jid_.host.split(".")[-len(local_host) :] == local_host
+ # FIXME: kept for compatiblity, need to be removed in favor of
+ # "self.client.is_local".
+
+ return self.client.is_local(jid_)
async def is_pubsub(self, jid_: jid.JID) -> bool:
"""Indicate if a JID is a Pubsub service"""