Mercurial > prosody-hg
comparison plugins/mod_uptime.lua @ 1524:a89fec6d76d2
mod_uptime: Fix bad uptime if module is loaded at startup
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Fri, 10 Jul 2009 15:33:53 +0100 |
| parents | 841d61be198f |
| children | 2140c994671e |
comparison
equal
deleted
inserted
replaced
| 1523:841d61be198f | 1524:a89fec6d76d2 |
|---|---|
| 13 local jid_split = require "util.jid".split; | 13 local jid_split = require "util.jid".split; |
| 14 local t_concat = table.concat; | 14 local t_concat = table.concat; |
| 15 | 15 |
| 16 local start_time = prosody.start_time; | 16 local start_time = prosody.start_time; |
| 17 | 17 |
| 18 prosody.events.add_handler("server-started", function () start_time = prosody.start_time end); | |
| 19 | |
| 18 module:add_feature("jabber:iq:last"); | 20 module:add_feature("jabber:iq:last"); |
| 19 | 21 |
| 20 module:add_iq_handler({"c2s", "s2sin"}, "jabber:iq:last", | 22 module:add_iq_handler({"c2s", "s2sin"}, "jabber:iq:last", |
| 21 function (origin, stanza) | 23 function (origin, stanza) |
| 22 if stanza.tags[1].name == "query" then | 24 if stanza.tags[1].name == "query" then |
