Fix terms: broadcasted messages should not be stored by mod_muc_mam.

This commit is contained in:
John Livingston 2024-06-27 15:14:49 +02:00
parent eaf3d85974
commit cad2eef7af
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
2 changed files with 12 additions and 0 deletions

View File

@ -116,3 +116,11 @@ module:hook("muc-occupant-groupchat", function(event)
return child; return child;
end); end);
end, 100); end, 100);
-- don't save terms messages in history
module:hook("muc-message-is-historic", function(event)
local stanza = event.stanza;
if (stanza:get_child("x-livechat-terms")) then
return false, "hint";
end
end, 1);

View File

@ -49,6 +49,10 @@ This also ensure clients will not drop the message because there is no occupant
When muc terms are updated, the new terms will be broadcasted. When muc terms are updated, the new terms will be broadcasted.
To avoid anyone spoofing terms & conditions, incoming message stanza are filtered, and any `x-livechat-terms` tag will be removed.
Message history is disabled for message containing the `x-livechat-terms`, so that messages broadcasted when the terms change are not stored by muc_mam modume ("Message Archiving Management").
## Frontend ## Frontend
For standard XMPP clients, terms will be shown as delayed messages. For standard XMPP clients, terms will be shown as delayed messages.