Changeset

1173:8999967fc4fe

mod_lastlog: Collect timestamp on registration
author Kim Alvefur <zash@zash.se>
date Wed, 28 Aug 2013 18:46:06 +0200
parents 1172:1e8b793d8ff9
children 1174:bd7901fef71b
files mod_lastlog/mod_lastlog.lua
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;