Changeset

3891:38504ec4c89b

mod_list_inactive: report last action timestamp
author Georg Lukas <georg@op-co.de>
date Mon, 17 Feb 2020 16:42:24 +0100
parents 3890:117a979ef930
children 3892:96a2e5097fc4
files mod_list_inactive/mod_list_inactive.lua
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mod_list_inactive/mod_list_inactive.lua	Sat Feb 08 15:29:35 2020 +0100
+++ b/mod_list_inactive/mod_list_inactive.lua	Mon Feb 17 16:42:24 2020 +0100
@@ -14,8 +14,8 @@
 
 local output_formats = {
 	default = "%s",
-	event = "%s %s",
-	delete = "user:delete%q -- %s"
+	event = "%s %s %s",
+	delete = "user:delete%q -- %s -- %s"
 }
 
 function module.command(arg)
@@ -24,7 +24,7 @@
 		print("time is a number followed by 'day', 'week', 'month' or 'year'");
 		print("formats are:");
 		for name, fmt in pairs(output_formats) do
-			print(name, fmt:format("user@example.com", "last action"))
+			print(name, fmt:format("user@example.com", "<last action>", "<last action timestamp>"))
 		end
 		return;
 	end
@@ -44,7 +44,7 @@
 		local last_action = last_active and last_active.event or "?"
 		last_active = last_active and last_active.timestamp or 0;
 		if last_active < max_age then
-			print(output:format(jid_join(user, host), last_action));
+			print(output:format(jid_join(user, host), last_action, os.date('%Y-%m-%d %H:%M:%S', last_active)));
 		end
 	end
 end