From e10171d44d362918cc0d4886e37018cd14843d0d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 20 Dec 2019 22:47:34 +0100 Subject: mod_adhoc: Improve permission setting (fix #1482) BC Rename 'user' permission mode to 'any' for clarity, too easily mistaken for what the 'local_user' setting does. It is also removed as a default and made a required argument. --- plugins/mod_uptime.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/mod_uptime.lua') diff --git a/plugins/mod_uptime.lua b/plugins/mod_uptime.lua index ccd8e511..035f7e9b 100644 --- a/plugins/mod_uptime.lua +++ b/plugins/mod_uptime.lua @@ -42,6 +42,6 @@ function uptime_command_handler () return { info = uptime_text(), status = "completed" }; end -local descriptor = adhoc_new("Get uptime", "uptime", uptime_command_handler); +local descriptor = adhoc_new("Get uptime", "uptime", uptime_command_handler, "any"); module:provides("adhoc", descriptor); -- cgit v1.2.3 From bc0e389d47b0a40e1ea871fe4ff583746af928be Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 22 Apr 2020 21:46:56 +0200 Subject: mod_uptime: Encode uptime as decimal, fix #1536 (thanks Martin) --- plugins/mod_uptime.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/mod_uptime.lua') diff --git a/plugins/mod_uptime.lua b/plugins/mod_uptime.lua index 035f7e9b..8a01fb17 100644 --- a/plugins/mod_uptime.lua +++ b/plugins/mod_uptime.lua @@ -16,7 +16,7 @@ module:add_feature("jabber:iq:last"); module:hook("iq-get/host/jabber:iq:last:query", function(event) local origin, stanza = event.origin, event.stanza; - origin.send(st.reply(stanza):tag("query", {xmlns = "jabber:iq:last", seconds = tostring(os.difftime(os.time(), start_time))})); + origin.send(st.reply(stanza):tag("query", {xmlns = "jabber:iq:last", seconds = tostring(("%d"):format(os.difftime(os.time(), start_time)))})); return true; end); -- cgit v1.2.3