mod_admin_telnet: Allow viewing HTTP event listeners via debug:events('http')

This commit is contained in:
Matthew Wild 2018-10-09 15:02:44 +01:00
parent fd3589a25e
commit e7d4ae6aac

View file

@ -1143,10 +1143,13 @@ end
function def_env.debug:events(host, event)
local events_obj;
if host and host ~= "*" then
if not prosody.hosts[host] then
if host == "http" then
events_obj = require "net.http.server"._events;
elseif not prosody.hosts[host] then
return false, "Unknown host: "..host;
else
events_obj = prosody.hosts[host].events;
end
events_obj = prosody.hosts[host].events;
else
events_obj = prosody.events;
end