# HG changeset patch # User Matthew Wild # Date 1607947765 0 # Node ID 020dd0a59f1f1238ef1328e7e35cadadda1ce324 # Parent 4a5c4a352b7881290055c3a1a3693c8b5eb29671 mod_muc_markers: Add option for @id rewriting, default off (may break some clients) XEP-0333 was updated to clarify that stanza-id should be used instead of the 'id' attribute when in a MUC. Some clients still use the id attribute, which is why we were rewriting it. Rewriting is bad because mod_muc advertises stable_id, indicating that Prosody does *not* rewrite ids. Recent versions of Conversations actually depend on this being true. All clients should migrate to using stanza-id for markers. See XEP-0333. diff -r 4a5c4a352b78 -r 020dd0a59f1f mod_muc_markers/mod_muc_markers.lua --- a/mod_muc_markers/mod_muc_markers.lua Mon Dec 14 13:05:18 2020 +0100 +++ b/mod_muc_markers/mod_muc_markers.lua Mon Dec 14 12:09:25 2020 +0000 @@ -21,6 +21,7 @@ end local marker_element_name = module:get_option_string("muc_marker_type", "displayed"); +local rewrite_id_attribute = module:get_option_boolean("muc_marker_rewrite_id", false); assert(marker_order[marker_element_name], "invalid marker name: "..marker_element_name); @@ -50,8 +51,11 @@ -- We are not interested in stanzas that didn't get archived if not archive_id then return; end - -- Add stanza id as id attribute - stanza.attr.id = archive_id; + if rewrite_id_attribute then + -- Add stanza id as id attribute + stanza.attr.id = archive_id; + end + -- Add markable element to request markers from clients stanza:tag("markable", { xmlns = xmlns_markers }):up(); end, -1);