From 2724c957228a36047f9ba311110e493116f20952 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sun, 26 Jul 2009 17:05:18 +0100 Subject: mod_console: Show status and priority of clients --- plugins/mod_console.lua | 13 +++++++++++-- 1 file 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"; -- cgit v1.2.3