diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-07-26 17:05:18 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-07-26 17:05:18 +0100 |
commit | 9a0d700321b59342c902f45d4aec76772c0f7f95 (patch) | |
tree | c3316a8d74904c7836839c6451bac5e23b70316c /plugins | |
parent | d6f3ce748bc5aa2e2d7676713f7564187afed9a6 (diff) | |
download | prosody-9a0d700321b59342c902f45d4aec76772c0f7f95.tar.gz prosody-9a0d700321b59342c902f45d4aec76772c0f7f95.zip |
mod_console: Show status and priority of clients
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_console.lua | 13 |
1 files changed, 11 insertions, 2 deletions
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"; |