Software / code / prosody
Comparison
plugins/mod_admin_telnet.lua @ 5231:4f9135e6c2f9
Merge 0.9->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 09 Dec 2012 12:39:49 +0100 |
| parent | 5227:97f395938028 |
| child | 5270:20e14961f630 |
comparison
equal
deleted
inserted
replaced
| 5226:c918aafb9c2e | 5231:4f9135e6c2f9 |
|---|---|
| 958 return nil, "No host given"; | 958 return nil, "No host given"; |
| 959 elseif not hosts[host] then | 959 elseif not hosts[host] then |
| 960 return nil, "No such host"; | 960 return nil, "No such host"; |
| 961 end | 961 end |
| 962 local print = self.session.print; | 962 local print = self.session.print; |
| 963 local count = 0; | 963 local total, matches = 0, 0; |
| 964 for user in um.users(host) do | 964 for user in um.users(host) do |
| 965 if not pat or user:match(pat) then | 965 if not pat or user:match(pat) then |
| 966 print(user.."@"..host); | 966 print(user.."@"..host); |
| 967 end | 967 matches = matches + 1; |
| 968 count = count + 1; | 968 end |
| 969 end | 969 total = total + 1; |
| 970 return true, count .. " users total"; | 970 end |
| 971 return true, "Showing "..(pat and (matches.." of ") or "all " )..total.." users"; | |
| 971 end | 972 end |
| 972 | 973 |
| 973 def_env.xmpp = {}; | 974 def_env.xmpp = {}; |
| 974 | 975 |
| 975 local st = require "util.stanza"; | 976 local st = require "util.stanza"; |