Changeset

5227:97f395938028

mod_admin_telnet: Improve wording when listing users
author Kim Alvefur <zash@zash.se>
date Sun, 09 Dec 2012 11:44:45 +0100
parents 5225:079e4cb23f89
children 5228:edabb34417b7
files plugins/mod_admin_telnet.lua
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_admin_telnet.lua	Tue Dec 04 20:08:44 2012 +0000
+++ b/plugins/mod_admin_telnet.lua	Sun Dec 09 11:44:45 2012 +0100
@@ -960,14 +960,15 @@
 		return nil, "No such host";
 	end
 	local print = self.session.print;
-	local count = 0;
+	local total, matches = 0, 0;
 	for user in um.users(host) do
 		if not pat or user:match(pat) then
 			print(user.."@"..host);
+			matches = matches + 1;
 		end
-		count = count + 1;
+		total = total + 1;
 	end
-	return true, count .. " users total";
+	return true, "Showing "..(pat and (matches.." of ") or "all " )..total.." users";
 end
 
 def_env.xmpp = {};