mod_cloud_notify_encrypted: Truncate message body to 255 characters
Total size limit is 3-4KB, and this should be enough for a small notification.
--- a/mod_cloud_notify_encrypted/mod_cloud_notify_encrypted.lua Wed Jan 13 14:18:24 2021 +0000
+++ b/mod_cloud_notify_encrypted/mod_cloud_notify_encrypted.lua Wed Jan 13 14:19:20 2021 +0000
@@ -56,6 +56,10 @@
local push_summary = event.push_summary;
local original_stanza = event.original_stanza;
+ local body = original_stanza:get_child_text("body");
+ if #body > 255 then
+ body = body:sub(1, 255);
+ end
local push_payload = {
unread = tonumber(push_summary["message-count"]) or 1;