Mercurial > prosody-modules
diff mod_unified_push/mod_unified_push.lua @ 5152:342baedbd1c8
mod_unified_push: Fix storage backend error behaviours and return values
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 14 Jan 2023 16:15:35 +0000 |
parents | 514c8a0e9aa1 |
children | d69cc9a23fad |
line wrap: on
line diff
--- a/mod_unified_push/mod_unified_push.lua Sat Jan 14 16:14:50 2023 +0000 +++ b/mod_unified_push/mod_unified_push.lua Sat Jan 14 16:15:35 2023 +0000 @@ -61,11 +61,10 @@ storage = { sign = function (data) local reg_id = id.long(); - local user, host = jid.split(data.sub); - if host ~= module.host or not user then - return; + local ok, err = push_store:set(reg_id, data); + if not ok then + return nil, err; end - push_store:set(reg_id, data); return reg_id; end; verify = function (token) @@ -77,7 +76,7 @@ push_store:set(token, nil); return nil, "token-expired"; end - return data; + return true, data; end; }; };