# HG changeset patch # User Matthew Wild # Date 1673712935 0 # Node ID 342baedbd1c8595c0da72d395fb608577c569bae # Parent 514c8a0e9aa1a8d8dd9df6294ffba0d2336a2c9f mod_unified_push: Fix storage backend error behaviours and return values diff -r 514c8a0e9aa1 -r 342baedbd1c8 mod_unified_push/mod_unified_push.lua --- 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; }; };