Comparison

plugins/mod_uptime.lua @ 4345:f6d694b1cdb3

mod_uptime: Use module:hook_global()
author Matthew Wild <mwild1@gmail.com>
date Sun, 14 Aug 2011 14:00:54 -0400
parent 3540:bc139431830b
child 5776:bd0ff8ae98a8
comparison
equal deleted inserted replaced
4344:a24ee48ec30d 4345:f6d694b1cdb3
7 -- 7 --
8 8
9 local st = require "util.stanza"; 9 local st = require "util.stanza";
10 10
11 local start_time = prosody.start_time; 11 local start_time = prosody.start_time;
12 prosody.events.add_handler("server-started", function() start_time = prosody.start_time end); 12 module:hook_global("server-started", function() start_time = prosody.start_time end);
13 13
14 -- XEP-0012: Last activity 14 -- XEP-0012: Last activity
15 module:add_feature("jabber:iq:last"); 15 module:add_feature("jabber:iq:last");
16 16
17 module:hook("iq/host/jabber:iq:last:query", function(event) 17 module:hook("iq/host/jabber:iq:last:query", function(event)