# HG changeset patch
# User Florian Zeitz <florob@babelmonkeys.de>
# Date 1411931210 -7200
# Node ID ddcb29a35409eb1f40c2a0f410d36c5541ba63d4
# Parent  b6514e691a70bc417980ec81f94a56567467332c
mod_admin_adhoc: Show IP in detailed version of online user listing

diff -r b6514e691a70 -r ddcb29a35409 plugins/mod_admin_adhoc.lua
--- 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