mod_uptime: Fix bad uptime if module is loaded at startup

Fri, 10 Jul 2009 15:33:53 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Fri, 10 Jul 2009 15:33:53 +0100
changeset 1524
a89fec6d76d2
parent 1523
841d61be198f
child 1525
f30886f684eb

mod_uptime: Fix bad uptime if module is loaded at startup

plugins/mod_uptime.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_uptime.lua	Fri Jul 10 03:11:45 2009 +0100
+++ b/plugins/mod_uptime.lua	Fri Jul 10 15:33:53 2009 +0100
@@ -15,6 +15,8 @@
 
 local start_time = prosody.start_time;
 
+prosody.events.add_handler("server-started", function () start_time = prosody.start_time end);
+
 module:add_feature("jabber:iq:last");
 
 module:add_iq_handler({"c2s", "s2sin"}, "jabber:iq:last", 

mercurial