aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-07-26 17:05:18 +0100
committerMatthew Wild <mwild1@gmail.com>2009-07-26 17:05:18 +0100
commit2724c957228a36047f9ba311110e493116f20952 (patch)
treeede996c91bfeab381f2e9baa664511ab0cefba56
parent51aec63307bd252c34d8172d8d1e3e5a8133d002 (diff)
downloadprosody-2724c957228a36047f9ba311110e493116f20952.tar.gz
prosody-2724c957228a36047f9ba311110e493116f20952.zip
mod_console: Show status and priority of clients
-rw-r--r--plugins/mod_console.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua
index a3ed9499..b3963d6c 100644
--- a/plugins/mod_console.lua
+++ b/plugins/mod_console.lua
@@ -359,10 +359,19 @@ end
function def_env.c2s:show(match_jid)
local print, count = self.session.print, 0;
- show_c2s(function (jid)
+ show_c2s(function (jid, session)
if (not match_jid) or jid:match(match_jid) then
count = count + 1;
- print(jid);
+ local status, priority = "unavailable", tostring(session.priority or "-");
+ if session.presence then
+ status = session.presence:child_with_name("show");
+ if status then
+ status = status:get_text() or "[invalid!]";
+ else
+ status = "available";
+ end
+ end
+ print(jid.." - "..status.."("..priority..")");
end
end);
return true, "Total: "..count.." clients";