Software /
code /
prosody-modules
Comparison
mod_lastlog2/mod_lastlog2.lua @ 6195:886c985ece61
mod_lastlog2: Skip initializing internal API (and storage) in prosodyctl
Initializing storage in the global context under prosodyctl causes the
module.command to fail to execute because the storage module has already
been loaded.
Introduced in 7b722955c59b
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 08 Feb 2025 14:12:18 +0100 |
parent | 5900:c5df6d53f17f |
child | 6196:1447f076c970 |
comparison
equal
deleted
inserted
replaced
6194:3e7fe14921d0 | 6195:886c985ece61 |
---|---|
45 }); | 45 }); |
46 end | 46 end |
47 end); | 47 end); |
48 end | 48 end |
49 | 49 |
50 do | 50 if module.host ~= "*" then |
51 local user_sessions = prosody.hosts[module.host].sessions; | 51 local user_sessions = prosody.hosts[module.host].sessions; |
52 local kv_store = module:open_store(); | 52 local kv_store = module:open_store(); |
53 function get_last_active(username) --luacheck: ignore 131/get_last_active | 53 function get_last_active(username) --luacheck: ignore 131/get_last_active |
54 if user_sessions[username] then | 54 if user_sessions[username] then |
55 return os.time(); -- Currently connected | 55 return os.time(); -- Currently connected |