#1054 Prosody does not set the @from attribute on MUC history <delay/> elements

Reporter Jonas Wielicki
Owner Zash
Created
Updated
Stars ★ (1)
Tags
  • Priority-Medium
  • Milestone-0.9
  • Type-Defect
  • Status-Fixed
  1. Jonas Wielicki on

    What steps will reproduce the problem? 1. Join a MUC with history What is the expected output? The history stanzas should have a <delay/> element with correct from attribute. What do you see instead? The <delay/> element lacks the from attribute. What version of the product are you using? On what operating system? 0.10-ish: 7503:df970f76c720 0.9-ish: 5769:0ec72e67f797 Please provide any additional information below. This is in violation of XEP-0045#enter-history (<https://xmpp.org/extensions/xep-0045.html#enter-history>): > Discussion history messages MUST be stamped with Delayed Delivery (XEP-0203) [14] information qualified by the 'urn:xmpp:delay' namespace to indicate that they are sent with delayed delivery and to specify the times at which they were originally sent. The 'from' attribute MUST be set to the JID of the room itself. This breaks history timestamping for clients which actually check the from.

  2. Jonas Wielicki on

    Patch: --- a/plugins/muc/muc.lib.lua Sat Dec 09 14:39:48 2017 +0100 +++ b/plugins/muc/muc.lib.lua Sat Dec 09 17:25:19 2017 +0100 @@ -135,8 +135,8 @@ stanza = st.clone(stanza); stanza.attr.to = ""; local stamp = datetime.datetime(); - stanza:tag("delay", {xmlns = "urn:xmpp:delay", from = muc_domain, stamp = stamp}):up(); -- XEP-0203 - stanza:tag("x", {xmlns = "jabber:x:delay", from = muc_domain, stamp = datetime.legacy()}):up(); -- XEP-0091 (deprecated) + stanza:tag("delay", {xmlns = "urn:xmpp:delay", from = self.jid, stamp = stamp}):up(); -- XEP-0203 + stanza:tag("x", {xmlns = "jabber:x:delay", from = self.jid, stamp = datetime.legacy()}):up(); -- XEP-0091 (deprecated) local entry = { stanza = stanza, stamp = stamp }; t_insert(history, entry); while #history > (self._data.history_length or default_history_length) do t_remove(history, 1) end

  3. Zash on

    Thanks for the report and patch, fixed in https://hg.prosody.im/0.9/rev/7ad9d7c4161c

    Changes
    • owner Zash
    • tags Status-Fixed Milestone-0.9

New comment

Not published. Used for spam prevention and optional update notifications.