Comparison

mod_mam_muc/mod_mam_muc.lua @ 1548:d3c847070618

mod_mam_muc: Store joins and leaves
author Kim Alvefur <zash@zash.se>
date Sat, 08 Nov 2014 15:47:30 +0100
parent 1547:e98c335c6554
child 1551:5127f4db9d39
comparison
equal deleted inserted replaced
1547:e98c335c6554 1548:d3c847070618
336 if stanza:get_child("body") then 336 if stanza:get_child("body") then
337 save_to_history(room, stanza); 337 save_to_history(room, stanza);
338 end 338 end
339 end); 339 end);
340 340
341 module:hook("muc-occupant-joined", function (event)
342 save_to_history(event.room, st.stanza("presence", { from = event.nick }));
343 end);
344 module:hook("muc-occupant-left", function (event)
345 save_to_history(event.room, st.stanza("presence", { type = "unavailable", from = event.nick }));
346 end);
347
341 module:hook("muc-room-destroyed", function(event) 348 module:hook("muc-room-destroyed", function(event)
342 local username = jid_split(event.room.jid); 349 local username = jid_split(event.room.jid);
343 archive:delete(username); 350 archive:delete(username);
344 end); 351 end);
345 352