Software /
code /
prosody-modules
Comparison
mod_cloud_notify/mod_cloud_notify.lua @ 2749:9756211fcbe3
mod_cloud_notify: Fix small bug.
See https://github.com/ChatSecure/ChatSecure-iOS/issues/770#issuecomment-323534057 for
a description of the bug.
author | tmolitor <thilo@eightysoft.de> |
---|---|
date | Tue, 22 Aug 2017 20:25:58 +0200 |
parent | 2736:fff185e7ab73 |
child | 2751:6b710a8bdf03 |
comparison
equal
deleted
inserted
replaced
2748:ff0495909d4e | 2749:9756211fcbe3 |
---|---|
75 .."error count for this identifier is now at %s", error_type, condition, push_identifier, | 75 .."error count for this identifier is now at %s", error_type, condition, push_identifier, |
76 tostring(push_errors[push_identifier])); | 76 tostring(push_errors[push_identifier])); |
77 if push_errors[push_identifier] >= max_push_errors then | 77 if push_errors[push_identifier] >= max_push_errors then |
78 module:log("warn", "Disabling push notifications for identifier '%s'", push_identifier); | 78 module:log("warn", "Disabling push notifications for identifier '%s'", push_identifier); |
79 -- remove push settings from sessions | 79 -- remove push settings from sessions |
80 for _, session in pairs(host_sessions[node].sessions) do | 80 if host_sessions[node] then |
81 if session.push_identifier == push_identifier then | 81 for _, session in pairs(host_sessions[node].sessions) do |
82 session.push_identifier = nil; | 82 if session.push_identifier == push_identifier then |
83 session.push_settings = nil; | 83 session.push_identifier = nil; |
84 session.push_settings = nil; | |
85 end | |
84 end | 86 end |
85 end | 87 end |
86 -- save changed global config | 88 -- save changed global config |
87 push_store:set_identifier(node, push_identifier, nil); | 89 push_store:set_identifier(node, push_identifier, nil); |
88 push_errors[push_identifier] = nil; | 90 push_errors[push_identifier] = nil; |