mod_lastlog/mod_lastlog.lua
changeset 1173 8999967fc4fe
parent 1172 1e8b793d8ff9
child 1174 bd7901fef71b
--- a/mod_lastlog/mod_lastlog.lua	Wed Aug 28 18:42:10 2013 +0200
+++ b/mod_lastlog/mod_lastlog.lua	Wed Aug 28 18:46:06 2013 +0200
@@ -26,6 +26,15 @@
 	end
 end);
 
+module:hook("user-registered", function(event)
+	local session = event.session;
+	datamanager.store(event.username, host, "lastlog", {
+		event = "registered";
+		timestamp = time(),
+		ip = log_ip and session.ip or nil,
+	});
+end);
+
 if module:get_option_boolean("lastlog_stamp_offline") then
 	local function offline_stamp(event)
 		local stanza = event.stanza;