aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-06-22 13:21:42 +0100
committerMatthew Wild <mwild1@gmail.com>2018-06-22 13:21:42 +0100
commit71620cbd9671248b3514d5988f8bb8a6d8d6f689 (patch)
treea79cc962d3da82e0205b12d77160f7b7af45562f
parentba4bd1e687fff494493a543e6c472ea272f4ec62 (diff)
parentd869a898035d7bd35daa5ce6ef973747e31ce8fc (diff)
downloadprosody-71620cbd9671248b3514d5988f8bb8a6d8d6f689.tar.gz
prosody-71620cbd9671248b3514d5988f8bb8a6d8d6f689.zip
Merge 0.10->trunk
-rw-r--r--plugins/mod_admin_telnet.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index 373ab81b..5bd32987 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -12,6 +12,7 @@ local hostmanager = require "core.hostmanager";
local modulemanager = require "core.modulemanager";
local s2smanager = require "core.s2smanager";
local portmanager = require "core.portmanager";
+local helpers = require "util.helpers";
local _G = _G;
@@ -1168,6 +1169,26 @@ function def_env.http:list()
return true;
end
+def_env.debug = {};
+
+function def_env.debug:logevents(host)
+ helpers.log_host_events(host);
+ return true;
+end
+
+function def_env.debug:events(host, event)
+ local events_obj;
+ if host and host ~= "*" then
+ if not hosts[host] then
+ return false, "Unknown host: "..host;
+ end
+ events_obj = hosts[host].events;
+ else
+ events_obj = prosody.events;
+ end
+ return true, helpers.show_events(events_obj, event);
+end
+
module:hook("server-stopping", function(event)
for conn, session in pairs(sessions) do
session.print("Shutting down: "..(event.reason or "unknown reason"));