diff options
Diffstat (limited to 'plugins/mod_uptime.lua')
-rw-r--r-- | plugins/mod_uptime.lua | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/plugins/mod_uptime.lua b/plugins/mod_uptime.lua index e52fd57e..ffb55a3c 100644 --- a/plugins/mod_uptime.lua +++ b/plugins/mod_uptime.lua @@ -7,27 +7,27 @@ -- -
-local st = require "util.stanza"
-
-local jid_split = require "util.jid".split;
-local t_concat = table.concat;
-
-local start_time = os.time();
-
-module:add_feature("jabber:iq:last");
-
-module:add_iq_handler({"c2s", "s2sin"}, "jabber:iq:last",
- function (origin, stanza)
- if stanza.tags[1].name == "query" then
- if stanza.attr.type == "get" then
- local node, host, resource = jid_split(stanza.attr.to);
- if node or resource then
- -- TODO
- else
- origin.send(st.reply(stanza):tag("query", {xmlns = "jabber:iq:last", seconds = tostring(os.difftime(os.time(), start_time))}));
- return true;
- end
- end
- end
- end);
+ +local st = require "util.stanza" + +local jid_split = require "util.jid".split; +local t_concat = table.concat; + +local start_time = os.time(); + +module:add_feature("jabber:iq:last"); + +module:add_iq_handler({"c2s", "s2sin"}, "jabber:iq:last", + function (origin, stanza) + if stanza.tags[1].name == "query" then + if stanza.attr.type == "get" then + local node, host, resource = jid_split(stanza.attr.to); + if node or resource then + -- TODO + else + origin.send(st.reply(stanza):tag("query", {xmlns = "jabber:iq:last", seconds = tostring(os.difftime(os.time(), start_time))})); + return true; + end + end + end + end); |