mod_console: Also search piggy-backed, er, multiplexed domains when passing a filter...
authorMatthew Wild <mwild1@gmail.com>
Mon, 5 Oct 2009 17:47:01 +0000 (18:47 +0100)
committerMatthew Wild <mwild1@gmail.com>
Mon, 5 Oct 2009 17:47:01 +0000 (18:47 +0100)
plugins/mod_console.lua

index 43cb8b133e3722acf52250ce368ef36f49ae528f..e2d3435fe85c60e93648f65bc40eee27dce10f51 100644 (file)
@@ -495,10 +495,14 @@ function def_env.s2s:show(match_jid)
                                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