# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1630401923 -7200
# Node ID c35b81575d5da79ce31053283b7ea0a772f0d62c
# Parent  8141645e38655d6febd2caf95c5e22ea1485fb7b
mod_mam: Explain behavior with absent mod_offline in a comment

diff -r 8141645e3865 -r c35b81575d5d plugins/mod_mam/mod_mam.lua
--- a/plugins/mod_mam/mod_mam.lua	Thu Jun 25 18:01:38 2020 +0200
+++ b/plugins/mod_mam/mod_mam.lua	Tue Aug 31 11:25:23 2021 +0200
@@ -474,6 +474,10 @@
 module:hook("pre-message/bare", strip_stanza_id_after_other_events, -1);
 module:hook("pre-message/full", strip_stanza_id_after_other_events, -1);
 
+-- Catch messages not stored by mod_offline and mark them as stored if they
+-- have been archived. This would generally only happen if mod_offline is
+-- disabled.  Otherwise the message would generate a delivery failure report,
+-- which would not be accurate because it has been archived.
 module:hook("message/offline/handle", function(event)
 	local stanza = event.stanza;
 	if stanza:get_child("stanza-id", xmlns_st_id) then