#922 mod_watchregistration does not reset stanza builder to the top tag
Reporter
Link Mauve
Owner
Zash
Created
Updated
Stars
★ (1)
Tags
Status-Fixed
Type-Defect
Priority-Medium
Milestone-0.9
Link Mauve
on
What steps will reproduce the problem?
1. Enable mod_mam.
2. Receive a delayed message (here from mod_watchregistration).
What is the expected output? What do you see instead?
I should get a message with a <stanza-id/> payload. Instead the <stanza-id/> is in the <body/> payload.
What version of the product are you using? On what operating system?
Prosody 0.10 commit 3e443d6791e6, on Lua 5.1 on ArchLinux.
Please provide any additional information below.
Here is the stanza I receive: <message xmlns="jabber:client" from="jabberfr.org" to="linkmauve@jabberfr.org" type="chat"><body>something something<stanza-id xmlns="urn:xmpp:sid:0" by="linkmauve@jabberfr.org" id="2017-05-21-e1b3c7ec269a5591" /></body><delay xmlns="urn:xmpp:delay" from="jabberfr.org"
stamp="2017-05-21T18:26:12Z" /></message>
Link Mauve
on
Correction, it doesn’t depend on whether it’s a delay message or not, and it doesn’t happen when I send a message from my other client, it’s probably an interaction between mod_watchregistration and mod_mam.
Zash
on
mod_watchregistration seems to leave the stanza with the body element as the "last added" element, so later changes will be relative to that. I think that's the problem, not mod_mam. Other modules should be able to count on the stanza builder pointing to the top tag when it receives them, and they should leave them in that state as well.
Changes
owner Zash
tags Milestone-0.9 Status-Accepted
titlestanza-id payload put at the wrong place for delayed messages mod_watchregistration does not reset stanza builder to the top tag
What steps will reproduce the problem? 1. Enable mod_mam. 2. Receive a delayed message (here from mod_watchregistration). What is the expected output? What do you see instead? I should get a message with a <stanza-id/> payload. Instead the <stanza-id/> is in the <body/> payload. What version of the product are you using? On what operating system? Prosody 0.10 commit 3e443d6791e6, on Lua 5.1 on ArchLinux. Please provide any additional information below. Here is the stanza I receive: <message xmlns="jabber:client" from="jabberfr.org" to="linkmauve@jabberfr.org" type="chat"><body>something something<stanza-id xmlns="urn:xmpp:sid:0" by="linkmauve@jabberfr.org" id="2017-05-21-e1b3c7ec269a5591" /></body><delay xmlns="urn:xmpp:delay" from="jabberfr.org" stamp="2017-05-21T18:26:12Z" /></message>
Correction, it doesn’t depend on whether it’s a delay message or not, and it doesn’t happen when I send a message from my other client, it’s probably an interaction between mod_watchregistration and mod_mam.
mod_watchregistration seems to leave the stanza with the body element as the "last added" element, so later changes will be relative to that. I think that's the problem, not mod_mam. Other modules should be able to count on the stanza builder pointing to the top tag when it receives them, and they should leave them in that state as well.
Changesstanza-id payload put at the wrong place for delayed messagesmod_watchregistration does not reset stanza builder to the top tagHave a patch: https://prosody.im/pastebin/46668d63-b636-421f-9bc3-8eb81365b69c
Thanks
Changes