Mercurial > prosody-modules
comparison mod_audit/mod_audit.lua @ 5761:754f8eaad34c
mod_audit: Fix error due to sub-second precision timestamps
os.date() does not handle them
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 02 Dec 2023 12:30:28 +0100 |
parents | 08a635862201 |
children | 6c0570a8b866 |
comparison
equal
deleted
inserted
replaced
5760:59e38aaa3ec1 | 5761:754f8eaad34c |
---|---|
219 print("EE: Failed to query audit log: "..tostring(err)); | 219 print("EE: Failed to query audit log: "..tostring(err)); |
220 return 1; | 220 return 1; |
221 end | 221 end |
222 | 222 |
223 local colspec = { | 223 local colspec = { |
224 { title = "Date", key = "when", width = 19, mapper = function (when) return os.date("%Y-%m-%d %R:%S", when); end }; | 224 { title = "Date", key = "when", width = 19, mapper = function (when) return os.date("%Y-%m-%d %R:%S", math.floor(when)); end }; |
225 { title = "Source", key = "source", width = "2p" }; | 225 { title = "Source", key = "source", width = "2p" }; |
226 { title = "Event", key = "event_type", width = "2p" }; | 226 { title = "Event", key = "event_type", width = "2p" }; |
227 }; | 227 }; |
228 | 228 |
229 if arg.show_user ~= false and (not arg.global and not query_jid) or arg.show_user then | 229 if arg.show_user ~= false and (not arg.global and not query_jid) or arg.show_user then |