diff options
author | Kim Alvefur <zash@zash.se> | 2018-03-25 17:02:00 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-03-25 17:02:00 +0200 |
commit | 668062a467b2601636132fd192c4a4fc4f9ed84b (patch) | |
tree | 9cfa37f110a5e1c00ef39cea8f30e72eac847f72 | |
parent | e50e0c22a4816071677db43cd7e51826ace54170 (diff) | |
download | prosody-668062a467b2601636132fd192c4a4fc4f9ed84b.tar.gz prosody-668062a467b2601636132fd192c4a4fc4f9ed84b.zip |
configmanager: Move firing of the 'config-reloaded' event into util.startup (fixes #1117)
-rw-r--r-- | core/configmanager.lua | 7 | ||||
-rw-r--r-- | util/startup.lua | 5 |
2 files changed, 5 insertions, 7 deletions
diff --git a/core/configmanager.lua b/core/configmanager.lua index 111c22a1..d9482b81 100644 --- a/core/configmanager.lua +++ b/core/configmanager.lua @@ -11,8 +11,6 @@ local setmetatable, rawget, rawset, io, error, dofile, type, pairs = setmetatable, rawget, rawset, io, error, dofile, type, pairs; local format, math_max = string.format, math.max; -local fire_event = prosody and prosody.events.fire_event or function () end; - local envload = require"util.envload".envload; local deps = require"util.dependencies"; local resolve_relative_path = require"util.paths".resolve_relative_path; @@ -86,11 +84,6 @@ function _M.load(filename, config_format) f:close(); if ok then config = new_config; - fire_event("config-reloaded", { - filename = filename, - format = config_format, - config = config - }); end return ok, "parser", err; end diff --git a/util/startup.lua b/util/startup.lua index a48c2fc7..ba83eca5 100644 --- a/util/startup.lua +++ b/util/startup.lua @@ -229,6 +229,11 @@ function startup.add_global_prosody_functions() elseif level == "file" then log("error", "Couldn't read the config file when trying to reload: %s", tostring(err)); end + else + prosody.events.fire_event("config-reloaded", { + filename = prosody.config_file, + config = config.getconfig(), + }); end return ok, (err and tostring(level)..": "..tostring(err)) or nil; end |