mod_console: Also search piggy-backed, er, multiplexed domains when passing a filter to s2s:show()

Mon, 05 Oct 2009 18:47:01 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Mon, 05 Oct 2009 18:47:01 +0100
changeset 1924
75e6ba240888
parent 1923
2d242334508d
child 1925
6897bd311afa

mod_console: Also search piggy-backed, er, multiplexed domains when passing a filter to s2s:show()

plugins/mod_console.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_console.lua	Mon Oct 05 18:42:42 2009 +0100
+++ b/plugins/mod_console.lua	Mon Oct 05 18:47:01 2009 +0100
@@ -495,10 +495,14 @@
 				end
 			end
 		end	
-		
+		local subhost_filter = function (h) 
+				return (match_jid and h:match(match_jid));
+			end
 		for session in pairs(incoming_s2s) do
 			if session.to_host == host and ((not match_jid) or host:match(match_jid) 
-				or (session.from_host and session.from_host:match(match_jid))) then
+				or (session.from_host and session.from_host:match(match_jid))
+				-- Pft! is what I say to list comprehensions
+				or (session.hosts and #array.collect(keys(session.hosts)):filter(subhost_filter)>0)) then
 				count_in = count_in + 1;
 				print("    "..host.." <- "..(session.from_host or "(unknown)")..(session.secure and "(encrypted)" or ""));
 				if session.type == "s2sin_unauthed" then

mercurial