comparison mod_muc_mam_hints/mod_muc_mam_hints.lua @ 3463:2aaf93d2b219

mod_muc_mam_hints: Respect XEP-0334 hints in MUC messages Hook muc-message-is-historic and check if Message Processing Hints are present to compute the return value.
author marc0s <marcos@tenak.net>
date Wed, 13 Feb 2019 15:52:58 +0100
parents
children
comparison
equal deleted inserted replaced
3462:d73ed7975d82 3463:2aaf93d2b219
1 --
2 -- A module to indicate if a MUC message qualifies as historic based on XEP-0334 hints
3 --
4
5 module:depends"muc_mam"
6
7 module:log("debug", "Module loaded");
8
9 module:hook("muc-message-is-historic", function (event)
10 if (event.stanza:get_child("no-store", "urn:xmpp:hints") or
11 event.stanza:get_child("no-permanent-store", "urn:xmpp:hints")) then
12 module:log("debug", "Not archiving stanza: %s (urn:xmpp:hints)", event.stanza)
13 return false
14 elseif event.stanza:get_child("store", "urn:xmpp:hints") then
15 return true
16 else
17 return nil
18 end
19 end)