# HG changeset patch # User Matthew Wild # Date 1610547560 0 # Node ID 2e355540f8c86f80612f35e2cca50fae155d7dd7 # Parent e655581173bede05513e86df372fd6d8a7f7f19f 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. diff -r e655581173be -r 2e355540f8c8 mod_cloud_notify_encrypted/mod_cloud_notify_encrypted.lua --- 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;