# HG changeset patch # User Matthew Wild # Date 1522146985 -3600 # Node ID 13acce68a89ce7510b0bc03d30ee1c7dcc02a46a # Parent 0f813e22e3fa969e6ff12ab94ec7ed6c0a1824b9 mod_component_http: Fix to use module:send() instead of origin.send() (thanks Wiktor) diff -r 0f813e22e3fa -r 13acce68a89c mod_component_http/mod_component_http.lua --- a/mod_component_http/mod_component_http.lua Tue Mar 27 10:51:25 2018 +0200 +++ b/mod_component_http/mod_component_http.lua Tue Mar 27 11:36:25 2018 +0100 @@ -32,7 +32,7 @@ end function handle_stanza(event) - local origin, stanza = event.origin, event.stanza; + local stanza = event.stanza; local request_body = json.encode({ to = stanza.attr.to; from = stanza.attr.from; @@ -50,7 +50,7 @@ local reply_stanza = xml.parse(response_data.stanza); if reply_stanza then reply_stanza.attr.from, reply_stanza.attr.to = stanza.attr.to, stanza.attr.from; - return origin.send(reply_stanza); + module:send(reply_stanza); else module:log("warn", "Unable to parse reply stanza"); end @@ -66,14 +66,14 @@ reply_stanza:tag("body"):text(tostring(response_data.body)):up(); end module:log("debug", "Sending %s", tostring(reply_stanza)); - return origin.send(reply_stanza); + module:send(reply_stanza); end - return; elseif code >= 200 and code <= 299 then - return true; + return; else - return origin.send(error_reply(stanza, code)); + module:send(error_reply(stanza, code)); end + return true; end); return true; end