comparison mod_mam_muc/mod_mam_muc.lua @ 1616:28411e97db94

mod_mam_muc: support to disable presence logging via muc_log_presences
author Stuart Carnie <stuart.carnie@gmail.com>
date Mon, 23 Feb 2015 16:43:21 -0700
parents eed7db9f3157
children 458c80904525
comparison
equal deleted inserted replaced
1615:d0fd8a29b724 1616:28411e97db94
343 if stanza:get_child("body") then 343 if stanza:get_child("body") then
344 save_to_history(room, stanza); 344 save_to_history(room, stanza);
345 end 345 end
346 end); 346 end);
347 347
348 module:hook("muc-occupant-joined", function (event) 348 if module:get_option_boolean("muc_log_presences", true) then
349 save_to_history(event.room, st.stanza("presence", { from = event.nick })); 349 module:hook("muc-occupant-joined", function (event)
350 end); 350 save_to_history(event.room, st.stanza("presence", { from = event.nick }));
351 module:hook("muc-occupant-left", function (event) 351 end);
352 save_to_history(event.room, st.stanza("presence", { type = "unavailable", from = event.nick })); 352 module:hook("muc-occupant-left", function (event)
353 end); 353 save_to_history(event.room, st.stanza("presence", { type = "unavailable", from = event.nick }));
354 end);
355 end
354 356
355 module:hook("muc-room-destroyed", function(event) 357 module:hook("muc-room-destroyed", function(event)
356 local username = jid_split(event.room.jid); 358 local username = jid_split(event.room.jid);
357 archive:delete(username); 359 archive:delete(username);
358 end); 360 end);