From 9a0d700321b59342c902f45d4aec76772c0f7f95 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(-) (limited to 'plugins/mod_console.lua') diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua index c3a12857..8b881c98 100644 --- a/plugins/mod_console.lua +++ b/plugins/mod_console.lua @@ -325,10 +325,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