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.
This commit is contained in:
Goffi 2025-05-06 00:34:01 +02:00
commit cfc4041b1d

View file

@ -218,15 +218,15 @@ class XEP_0045:
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: