From a909d99fa9677c56e7eeaae1a63c76859afd7f46 Mon Sep 17 00:00:00 2001 From: Goffi Date: Sat, 20 Jun 2026 15:06:55 +0200 Subject: [PATCH] plugin XEP-0374, XEP-0384: use `debug` instead of `warning` logs: Those cases are expected on semi-anonymous rooms, thus a warning is inappropriate. --- libervia/backend/plugins/plugin_xep_0374.py | 6 ++++-- libervia/backend/plugins/plugin_xep_0384.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/libervia/backend/plugins/plugin_xep_0374.py b/libervia/backend/plugins/plugin_xep_0374.py index a3b75dd8..c2207e56 100644 --- a/libervia/backend/plugins/plugin_xep_0374.py +++ b/libervia/backend/plugins/plugin_xep_0374.py @@ -176,7 +176,8 @@ class XEP_0374: sender_user = cast(Optional[muc.User], room.getUser(sender_jid.resource)) if sender_user is None: - log.warning( + # This is expected when presence broadcast is restricted for the sender's role + log.debug( f"Ignoring MUC message from room {room_jid} since the sender's user" f" wasn't found {sender_jid.resource}" ) @@ -185,7 +186,8 @@ class XEP_0374: sender_user_jid = cast(Optional[jid.JID], sender_user.entity) if sender_user_jid is None: - log.warning( + # This is expected in semi-anonymous rooms + log.debug( f"Ignoring MUC message from room {room_jid} since the sender's bare" f" JID couldn't be found from its user information: {sender_user}" ) diff --git a/libervia/backend/plugins/plugin_xep_0384.py b/libervia/backend/plugins/plugin_xep_0384.py index 91722e13..d57da00c 100644 --- a/libervia/backend/plugins/plugin_xep_0384.py +++ b/libervia/backend/plugins/plugin_xep_0384.py @@ -2205,7 +2205,8 @@ class OMEMO: sender_user = cast(Optional[muc.User], room.getUser(sender_jid.resource)) if sender_user is None: - log.warning( + # This is expected when presence broadcast is restricted for the sender's role + log.debug( f"Ignoring MUC message from room {room_jid} since the sender's user" f" wasn't found {sender_jid.resource}" ) @@ -2214,7 +2215,8 @@ class OMEMO: sender_user_jid = cast(Optional[jid.JID], sender_user.entity) if sender_user_jid is None: - log.warning( + # This is expected in semi-anonymous rooms + log.debug( f"Ignoring MUC message from room {room_jid} since the sender's bare" f" JID couldn't be found from its user information: {sender_user}" )