Software /
code /
prosody-modules
Comparison
mod_cloud_notify_encrypted/mod_cloud_notify_encrypted.lua @ 4373:41ac0941b217
mod_cloud_notify_encrypted: Fix traceback on push of message with no body
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 22 Jan 2021 22:05:05 +0000 |
parent | 4333:97f369745ec7 |
child | 4456:8ed1989e99f9 |
comparison
equal
deleted
inserted
replaced
4372:78de3c7acf58 | 4373:41ac0941b217 |
---|---|
55 | 55 |
56 local push_summary = event.push_summary; | 56 local push_summary = event.push_summary; |
57 | 57 |
58 local original_stanza = event.original_stanza; | 58 local original_stanza = event.original_stanza; |
59 local body = original_stanza:get_child_text("body"); | 59 local body = original_stanza:get_child_text("body"); |
60 if #body > 255 then | 60 if body and #body > 255 then |
61 body = body:sub(1, 255); | 61 body = body:sub(1, 255); |
62 end | 62 end |
63 | 63 |
64 local push_payload = { | 64 local push_payload = { |
65 unread = tonumber(push_summary["message-count"]) or 1; | 65 unread = tonumber(push_summary["message-count"]) or 1; |