Diff

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
line wrap: on
line diff
--- a/plugins/mod_admin_telnet.lua	Fri May 17 14:56:36 2013 +0100
+++ b/plugins/mod_admin_telnet.lua	Fri May 17 18:28:05 2013 +0200
@@ -538,12 +538,7 @@
 			count = count + 1;
 			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
+				status = session.presence:get_child_text("show") or "available";
 			end
 			print(session_flags(session, { "   "..jid.." - "..status.."("..priority..")" }));
 		end