Diff

plugins/mod_offline.lua @ 10296:7072569044d4

mod_offline: Log a debug message when message is stored
author Kim Alvefur <zash@zash.se>
date Sun, 29 Sep 2019 23:50:34 +0200
parent 10242:7e5d2a6c9390
child 12977:74b9e05af71e
line wrap: on
line diff
--- a/plugins/mod_offline.lua	Sun Sep 29 21:12:46 2019 +0200
+++ b/plugins/mod_offline.lua	Sun Sep 29 23:50:34 2019 +0200
@@ -24,7 +24,11 @@
 		node = origin.username;
 	end
 
-	return offline_messages:append(node, nil, stanza, os.time(), "");
+	local ok = offline_messages:append(node, nil, stanza, os.time(), "");
+	if ok then
+		module:log("debug", "Saved to offline storage: %s", stanza:top_tag());
+	end
+	return ok;
 end, -1);
 
 module:hook("message/offline/broadcast", function(event)