Diff

plugins/mod_admin_adhoc.lua @ 6457:ddcb29a35409

mod_admin_adhoc: Show IP in detailed version of online user listing
author Florian Zeitz <florob@babelmonkeys.de>
date Sun, 28 Sep 2014 21:06:50 +0200
parent 5818:5733a277237a
child 6458:f906b803dc42
line wrap: on
line diff
--- a/plugins/mod_admin_adhoc.lua	Fri Sep 26 22:12:21 2014 +0200
+++ b/plugins/mod_admin_adhoc.lua	Sun Sep 28 21:06:50 2014 +0200
@@ -345,7 +345,7 @@
 		count = count + 1;
 		if fields.details then
 			for resource, session in pairs(user.sessions or {}) do
-				local status, priority = "unavailable", tostring(session.priority or "-");
+				local status, priority, ip = "unavailable", tostring(session.priority or "-"), session.ip or "<unknown>";
 				if session.presence then
 					status = session.presence:child_with_name("show");
 					if status then
@@ -354,7 +354,7 @@
 						status = "available";
 					end
 				end
-				users[#users+1] = " - "..resource..": "..status.."("..priority..")";
+				users[#users+1] = " - "..resource..": "..status.."("..priority.."), IP: ["..ip.."]";
 			end
 		end
 	end