# HG changeset patch # User Kim Alvefur # Date 1377708366 -7200 # Node ID 8999967fc4fefe60f6f3ecd93cdc20e3ab784b26 # Parent 1e8b793d8ff9a0a08d0d15868eee59f8420b42ca mod_lastlog: Collect timestamp on registration diff -r 1e8b793d8ff9 -r 8999967fc4fe mod_lastlog/mod_lastlog.lua --- 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;