Mercurial > prosody-hg
comparison plugins/mod_uptime.lua @ 541:3521e0851c9e
Change modules to use the new add_feature module API method.
This also fixes the bug causing disco features being added to every disco reply for every host.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Thu, 04 Dec 2008 20:16:30 +0500 |
| parents | cccd610a0ef9 |
| children | 4ae3e81513f3 |
comparison
equal
deleted
inserted
replaced
| 540:ec03f6968fa8 | 541:3521e0851c9e |
|---|---|
| 24 local jid_split = require "util.jid".split; | 24 local jid_split = require "util.jid".split; |
| 25 local t_concat = table.concat; | 25 local t_concat = table.concat; |
| 26 | 26 |
| 27 local start_time = os.time(); | 27 local start_time = os.time(); |
| 28 | 28 |
| 29 require "core.discomanager".set("uptime", "jabber:iq:last"); | 29 module:add_feature("jabber:iq:last"); |
| 30 | 30 |
| 31 module:add_iq_handler({"c2s", "s2sin"}, "jabber:iq:last", | 31 module:add_iq_handler({"c2s", "s2sin"}, "jabber:iq:last", |
| 32 function (origin, stanza) | 32 function (origin, stanza) |
| 33 if stanza.tags[1].name == "query" then | 33 if stanza.tags[1].name == "query" then |
| 34 if stanza.attr.type == "get" then | 34 if stanza.attr.type == "get" then |
