Diff

plugins/mod_uptime.lua @ 10749:abbdf72b0710

mod_uptime: Encode uptime as decimal, fix #1536 (thanks Martin)
author Kim Alvefur <zash@zash.se>
date Wed, 22 Apr 2020 21:46:56 +0200
parent 10565:421b2f8369fd
child 12977:74b9e05af71e
line wrap: on
line diff
--- a/plugins/mod_uptime.lua	Wed Apr 22 21:38:36 2020 +0200
+++ b/plugins/mod_uptime.lua	Wed Apr 22 21:46:56 2020 +0200
@@ -16,7 +16,7 @@
 
 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);