# HG changeset patch # User Kim Alvefur # Date 1630402689 -7200 # Node ID d66738eeb87595bec8391fb9fe73470fead62502 # Parent 9925be5d3b8b8ae9f98cb780cdcc1d0f58bf3140 mod_mam: Suppress offline message broadcast for MAM clients MattJ on 09:34:24 > Zash: I think as a first step, offline messages should not be sent to > clients that request MAM https://chat.modernxmpp.org/log/modernxmpp/2021-08-31#2021-08-31-8518a542bd283686 diff -r 9925be5d3b8b -r d66738eeb875 CHANGES --- a/CHANGES Tue Aug 31 11:26:42 2021 +0200 +++ b/CHANGES Tue Aug 31 11:38:09 2021 +0200 @@ -27,6 +27,7 @@ - mod_server_contact_info now loaded on components if enabled - Statistics now based on OpenMetrics - Direct TLS support +- Offline messages aren't sent to MAM clients 0.11.0 ====== diff -r 9925be5d3b8b -r d66738eeb875 plugins/mod_mam/mod_mam.lua --- a/plugins/mod_mam/mod_mam.lua Tue Aug 31 11:26:42 2021 +0200 +++ b/plugins/mod_mam/mod_mam.lua Tue Aug 31 11:38:09 2021 +0200 @@ -488,6 +488,13 @@ end end, -2); +-- Don't broadcast offline messages to clients that have queried the archive. +module:hook("message/offline/broadcast", function (event) + if event.origin.mam_requested then + return true; + end +end); + if cleanup_after ~= "never" then local cleanup_storage = module:open_store("archive_cleanup"); local cleanup_map = module:open_store("archive_cleanup", "map");