# HG changeset patch # User Matthew Wild # Date 1490260676 0 # Node ID 0f1421af7f6a343e288f74223f42a4bc5aece5cb # Parent 2d83e6c8160bd407f9a27719b51168aed9c8eb49 mod_cloud_notify: Move declarations of handle_push_success/error to fix referencing undefined variables (introduced in 6ab46ff685d0) diff -r 2d83e6c8160b -r 0f1421af7f6a mod_cloud_notify/mod_cloud_notify.lua --- a/mod_cloud_notify/mod_cloud_notify.lua Wed Mar 22 19:47:52 2017 +0100 +++ b/mod_cloud_notify/mod_cloud_notify.lua Thu Mar 23 09:17:56 2017 +0000 @@ -55,7 +55,10 @@ return api; end)(); -local function handle_push_error(event) +-- Forward declarations, as both functions need to reference each other +local handle_push_success, handle_push_error; + +function handle_push_error(event) local stanza = event.stanza; local error_type, condition = stanza:get_error(); local node = jid.split(stanza.attr.to); @@ -94,7 +97,7 @@ return true; end -local function handle_push_success(event) +function handle_push_success(event) local stanza = event.stanza; local node = jid.split(stanza.attr.to); local from = stanza.attr.from;