# HG changeset patch # User Stuart Carnie # Date 1424735001 25200 # Node ID 28411e97db940fe77212a100b126f34c4e628274 # Parent d0fd8a29b72443ad8a8b251a9088627134a29d6d mod_mam_muc: support to disable presence logging via muc_log_presences diff -r d0fd8a29b724 -r 28411e97db94 mod_mam_muc/mod_mam_muc.lua --- a/mod_mam_muc/mod_mam_muc.lua Mon Feb 23 15:45:11 2015 +0100 +++ b/mod_mam_muc/mod_mam_muc.lua Mon Feb 23 16:43:21 2015 -0700 @@ -345,12 +345,14 @@ end end); -module:hook("muc-occupant-joined", function (event) - save_to_history(event.room, st.stanza("presence", { from = event.nick })); -end); -module:hook("muc-occupant-left", function (event) - save_to_history(event.room, st.stanza("presence", { type = "unavailable", from = event.nick })); -end); +if module:get_option_boolean("muc_log_presences", true) then + module:hook("muc-occupant-joined", function (event) + save_to_history(event.room, st.stanza("presence", { from = event.nick })); + end); + module:hook("muc-occupant-left", function (event) + save_to_history(event.room, st.stanza("presence", { type = "unavailable", from = event.nick })); + end); +end module:hook("muc-room-destroyed", function(event) local username = jid_split(event.room.jid);