# HG changeset patch # User kmq # Date 1783340637 -7200 # Node ID 5da6fb562df9f74dd53625c038c1b8a701e837e0 # Parent 93544117ddcd8097ad68a04e42e188cea47e99fb mod_unified_push: Fix push error handling (fixes #2000) Use the error object that send_iq() passes as an argument to it's reject callback instead of attempting and failing to do the parsing in the callback itself. diff -r 93544117ddcd -r 5da6fb562df9 mod_unified_push/mod_unified_push.lua --- a/mod_unified_push/mod_unified_push.lua Mon Jun 08 22:42:05 2026 +0200 +++ b/mod_unified_push/mod_unified_push.lua Mon Jul 06 14:23:57 2026 +0200 @@ -182,16 +182,15 @@ return module:send_iq(push_iq):next(function () module:log("debug", "Push notification delivered [%s]", push_id); return 201; - end, function (error_event) - local e_type, e_cond, e_text = error_event.stanza:get_error(); - if e_cond == "item-not-found" or e_cond == "feature-not-implemented" then + end, function (err) + if err.condition == "item-not-found" or err.condition == "feature-not-implemented" then module:log("debug", "Push rejected [%s]", push_id); return 404; - elseif e_cond == "service-unavailable" or e_cond == "recipient-unavailable" then + elseif err.condition == "service-unavailable" or err.condition == "recipient-unavailable" then module:log("debug", "Recipient temporarily unavailable [%s]", push_id); return 503; end - module:log("warn", "Unexpected push error response: %s/%s/%s", e_type, e_cond, e_text); + module:log("warn", "Unexpected push error response: %s/%s/%s", err.type, err.condition, err.text); return 500; end); end