# HG changeset patch # User Matthew Wild # Date 1248624318 -3600 # Node ID 4c8f3fa9d926730748a39a010fda5521812631d9 # Parent 5f7b2f940816e0028d144cb014971afddf884be8 mod_console: Show status and priority of clients diff -r 5f7b2f940816 -r 4c8f3fa9d926 plugins/mod_console.lua --- a/plugins/mod_console.lua Sun Sep 20 15:16:25 2009 +0100 +++ b/plugins/mod_console.lua Sun Jul 26 17:05:18 2009 +0100 @@ -359,10 +359,19 @@ 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";