Software /
code /
prosody
Comparison
plugins/mod_admin_telnet.lua @ 5593:98a485212592
mod_admin_telnet: Use stanza:get_child_text()
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 17 May 2013 18:28:05 +0200 |
parent | 5586:7e1264bf7af8 |
child | 5599:34e9f237b915 |
comparison
equal
deleted
inserted
replaced
5592:5705e21ba24b | 5593:98a485212592 |
---|---|
536 end | 536 end |
537 if (not match_jid) or jid:match(match_jid) then | 537 if (not match_jid) or jid:match(match_jid) then |
538 count = count + 1; | 538 count = count + 1; |
539 local status, priority = "unavailable", tostring(session.priority or "-"); | 539 local status, priority = "unavailable", tostring(session.priority or "-"); |
540 if session.presence then | 540 if session.presence then |
541 status = session.presence:child_with_name("show"); | 541 status = session.presence:get_child_text("show") or "available"; |
542 if status then | |
543 status = status:get_text() or "[invalid!]"; | |
544 else | |
545 status = "available"; | |
546 end | |
547 end | 542 end |
548 print(session_flags(session, { " "..jid.." - "..status.."("..priority..")" })); | 543 print(session_flags(session, { " "..jid.." - "..status.."("..priority..")" })); |
549 end | 544 end |
550 end); | 545 end); |
551 return true, "Total: "..count.." clients"; | 546 return true, "Total: "..count.." clients"; |