aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGES1
-rw-r--r--plugins/mod_mam/mod_mam.lua7
2 files changed, 8 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index 5a1f7d9b..1e65448f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -27,6 +27,7 @@ TRUNK
- 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 --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua
index 50401aa1..f0f8c4ec 100644
--- a/plugins/mod_mam/mod_mam.lua
+++ b/plugins/mod_mam/mod_mam.lua
@@ -488,6 +488,13 @@ module:hook("message/offline/handle", function(event)
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");