mod_audit: Allow caller to specify time of the event
authorMatthew Wild <mwild1@gmail.com>
Fri, 07 Apr 2023 12:00:06 +0100
changeset 5321 0091b7de2763
parent 5320 4fc3277a914d
child 5322 c5ecfb06afde
mod_audit: Allow caller to specify time of the event
mod_audit/mod_audit.lua
--- a/mod_audit/mod_audit.lua	Fri Apr 07 11:38:46 2023 +0200
+++ b/mod_audit/mod_audit.lua	Fri Apr 07 12:00:06 2023 +0100
@@ -111,7 +111,7 @@
 		end
 	end
 
-	local id, err = stores[host]:append(nil, nil, stanza, time_now(), user_key);
+	local id, err = stores[host]:append(nil, nil, stanza, extra and extra.timestamp or time_now(), user_key);
 	if err then
 		module:log("error", "failed to persist audit event: %s", err);
 		return