Changeset

1496:cccb151a4cc5

mod_list_inactive: Delay joining JIDs until they are used
author Kim Alvefur <zash@zash.se>
date Tue, 26 Aug 2014 16:15:23 +0200
parents 1495:9a1b3f0d0939
children 1497:d1836dfa4ae4
files mod_list_inactive/mod_list_inactive.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_list_inactive/mod_list_inactive.lua	Mon Aug 25 23:58:50 2014 +0700
+++ b/mod_list_inactive/mod_list_inactive.lua	Tue Aug 26 16:15:23 2014 +0200
@@ -3,6 +3,7 @@
 local um = require "core.usermanager";
 local sm = require "core.storagemanager";
 local dm_load = require "util.datamanager".load;
+local jid_join = require"util.jid".join;
 
 local multipliers = {
 	d = 86400, -- day
@@ -23,9 +24,8 @@
 	for user in um.users(host) do
 		local last_active = dm_load(user, host, "lastlog");
 		last_active = last_active and last_active.timestamp or 0;
-		local bare = user.."@"..host;
 		if last_active < max_age then
-			print(("user:delete%q"):format(bare));
+			print(("user:delete%q"):format(jid_join(user, host)));
 		end
 	end
 end