diff 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
parents e98c335c6554
children 5127f4db9d39
line wrap: on
line diff
--- a/mod_mam_muc/mod_mam_muc.lua	Sat Nov 08 15:46:47 2014 +0100
+++ b/mod_mam_muc/mod_mam_muc.lua	Sat Nov 08 15:47:30 2014 +0100
@@ -338,6 +338,13 @@
 	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);
+
 module:hook("muc-room-destroyed", function(event)
 	local username = jid_split(event.room.jid);
 	archive:delete(username);