diff plugins/mod_account_activity.lua @ 14047:f463e101fbd9 13.0 13.0.4

mod_account_activity: Handle authentication provider returning no user info
author Matthew Wild <mwild1@gmail.com>
date Tue, 20 Jan 2026 11:04:41 +0000
parents 0055c177a54c
children 04c3687b5641 0c81b8fede94
line wrap: on
line diff
--- a/plugins/mod_account_activity.lua	Sun Jan 18 14:56:01 2026 +0100
+++ b/plugins/mod_account_activity.lua	Tue Jan 20 11:04:41 2026 +0000
@@ -69,11 +69,16 @@
 		for username in um.users(host) do
 			local last_active = store:get_key(username, "timestamp");
 			if not last_active then
-				local created_at = um.get_account_info(username, host).created;
-				if created_at and (now - created_at) > duration_sec then
-					self.session.print(username, "");
-					n_inactive = n_inactive + 1;
-				elseif not created_at then
+				local user_info = um.get_account_info(username, host);
+				local created_at;
+				if user_info then
+					created_at  = user_info.created;
+					if created_at and (now - created_at) > duration_sec then
+						self.session.print(username, "");
+						n_inactive = n_inactive + 1;
+					end
+				end
+				if not created_at then
 					n_unknown = n_unknown + 1;
 				end
 			elseif (now - last_active) > duration_sec then