diff -r 3d6e0e037dab -r 39c7115be370 mod_stanza_counter/mod_stanza_counter_http.lua --- a/mod_stanza_counter/mod_stanza_counter_http.lua Sun Jan 08 03:52:06 2012 +0000 +++ b/mod_stanza_counter/mod_stanza_counter_http.lua Sun Jan 08 03:52:38 2012 +0000 @@ -15,11 +15,11 @@ local function res(code, r, h) local response = { - status = code; - body = r; - } + status = code, + body = r + } - if h then response.headers = h; end + if h then response.headers = h end return response end @@ -33,7 +33,7 @@ prosody.stanza_counter.message["incoming"], prosody.stanza_counter.message["outgoing"], prosody.stanza_counter.presence["incoming"], - prosody.stanza_counter.presence["outgoing"]); + prosody.stanza_counter.presence["outgoing"]) return res(200, forge_res) else local err405 = r_err:format("405", "Only GET is supported") @@ -47,5 +47,5 @@ httpserver.new_from_config(ports, req, { base = "stanza-counter" }) end --- hook server started -module:hook("server-started", setup) +-- set it +if prosody.start_time then setup() else module:hook("server-started", setup) end