diff options
author | Waqas Hussain <waqas20@gmail.com> | 2009-06-12 13:46:31 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2009-06-12 13:46:31 +0500 |
commit | 579f4853288925d6312af5677e3d7f072b81f1b2 (patch) | |
tree | de8f3faa8b1483c5a800f2d6abfa31376ad938d8 /plugins | |
parent | 5e62fe6fdbf2dfd0fad41b1ee027cc14114dd84e (diff) | |
parent | aa79672dbdd1bef94119e520daacb47ac06d3935 (diff) | |
download | prosody-579f4853288925d6312af5677e3d7f072b81f1b2.tar.gz prosody-579f4853288925d6312af5677e3d7f072b81f1b2.zip |
Merge
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_console.lua | 8 | ||||
-rw-r--r-- | plugins/mod_message.lua | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua index c676c0eb..77d76a82 100644 --- a/plugins/mod_console.lua +++ b/plugins/mod_console.lua @@ -318,10 +318,14 @@ def_env.s2s = {}; function def_env.s2s:show(match_jid) local _print = self.session.print; local print = self.session.print; + + local count_in, count_out = 0,0; + for host, host_session in pairs(hosts) do print = function (...) _print(host); _print(...); print = _print; end for remotehost, session in pairs(host_session.s2sout) do if (not match_jid) or remotehost:match(match_jid) or host:match(match_jid) then + count_out = count_out + 1; print(" "..host.." -> "..remotehost); if session.sendq then print(" There are "..#session.sendq.." queued outgoing stanzas for this connection"); @@ -354,6 +358,7 @@ function def_env.s2s:show(match_jid) 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 + count_in = count_in + 1; print(" "..host.." <- "..(session.from_host or "(unknown)")); if session.type == "s2sin_unauthed" then print(" Connection not yet authenticated"); @@ -371,10 +376,13 @@ function def_env.s2s:show(match_jid) for session in pairs(incoming_s2s) do if not session.to_host and ((not match_jid) or session.from_host and session.from_host:match(match_jid)) then + count_in = count_in + 1; print("Other incoming s2s connections"); print(" (unknown) <- "..(session.from_host or "(unknown)")); end end + + return true, "Total: "..count_out.." outgoing, "..count_in.." incoming connections"; end ------------- diff --git a/plugins/mod_message.lua b/plugins/mod_message.lua index eb6982f4..048a578d 100644 --- a/plugins/mod_message.lua +++ b/plugins/mod_message.lua @@ -2,6 +2,7 @@ local full_sessions = full_sessions; local bare_sessions = bare_sessions; +local st = require "util.stanza"; local jid_bare = require "util.jid".bare; local jid_split = require "util.jid".split; local user_exists = require "core.usermanager".user_exists; |