# HG changeset patch # User Goffi # Date 1746484441 -7200 # Node ID b74a76a8e168dca79c47bc292812f49ee033bf7f # Parent 2bdf0c16d8528632018476cbdc17718bba5eec4f plugin XEP-0045: Fix `_message_parse_trigger` which was incorrectly breaking the trigger workflow: `None` was returned in some case instead of `True`, breaking the trigger workflow. diff -r 2bdf0c16d852 -r b74a76a8e168 libervia/backend/plugins/plugin_xep_0045.py --- a/libervia/backend/plugins/plugin_xep_0045.py Tue May 06 00:34:01 2025 +0200 +++ b/libervia/backend/plugins/plugin_xep_0045.py Tue May 06 00:34:01 2025 +0200 @@ -218,15 +218,15 @@ def _message_parse_trigger(self, client, message_elt, data): """Add stanza-id from the room if present""" - if message_elt.getAttribute("type") != C.MESS_TYPE_GROUPCHAT: - return True + if message_elt.getAttribute("type") == C.MESS_TYPE_GROUPCHAT: + # stanza_id will not be filled by parse_message because the emitter + # is the room and not our server, so we have to parse it here + room_jid = data["from"].userhostJID() + stanza_id = self._si.get_stanza_id(message_elt, room_jid) + if stanza_id: + data["extra"]["stanza_id"] = stanza_id - # stanza_id will not be filled by parse_message because the emitter - # is the room and not our server, so we have to parse it here - room_jid = data["from"].userhostJID() - stanza_id = self._si.get_stanza_id(message_elt, room_jid) - if stanza_id: - data["extra"]["stanza_id"] = stanza_id + return True def message_received_trigger(self, client, message_elt, post_treat): if message_elt.getAttribute("type") == C.MESS_TYPE_GROUPCHAT: