diff mod_cloud_notify_encrypted/mod_cloud_notify_encrypted.lua @ 5054:62480053c87b

mod_cloud_notify_encrypted: Additional debug logging when enabling/skipping
author Matthew Wild <mwild1@gmail.com>
date Fri, 23 Sep 2022 22:41:15 +0100
parents 8231774f5bfd
children 3b609eaf0db5
line wrap: on
line diff
--- a/mod_cloud_notify_encrypted/mod_cloud_notify_encrypted.lua	Fri Sep 23 22:40:54 2022 +0100
+++ b/mod_cloud_notify_encrypted/mod_cloud_notify_encrypted.lua	Fri Sep 23 22:41:15 2022 +0100
@@ -52,6 +52,8 @@
 		return false;
 	end
 
+	module:log("debug", "Encrypted push notifications enabled");
+
 	event.push_info.encryption = {
 		algorithm = algorithm;
 		key_base64 = key_base64;
@@ -60,7 +62,10 @@
 
 function handle_push(event)
 	local encryption = event.push_info.encryption;
-	if not encryption then return; end
+	if not encryption then
+		module:log("debug", "Encryption not enabled for this notification");
+		return;
+	end
 
 	if encryption.algorithm ~= "aes-128-gcm" then
 		event.reason = "Unsupported encryption algorithm: "..tostring(encryption.algorithm);