# HG changeset patch # User Kim Alvefur # Date 1527944427 -7200 # Node ID 3a6a48b83b4ff589449e083fe951ddfdb2e8b963 # Parent 39d714abbc2b8b61913ab135f9dfbd12eb36d9ea mod_slack_webhooks: Reduce scope of variable diff -r 39d714abbc2b -r 3a6a48b83b4f mod_slack_webhooks/mod_slack_webhooks.lua --- a/mod_slack_webhooks/mod_slack_webhooks.lua Sat Jun 02 14:59:09 2018 +0200 +++ b/mod_slack_webhooks/mod_slack_webhooks.lua Sat Jun 02 15:00:27 2018 +0200 @@ -93,7 +93,6 @@ local headers = request.headers; local body_type = headers.content_type; - local message; local post_body; if body_type == "application/x-www-form-urlencoded" then post_body = formdecode(request.body)["payload"]; @@ -113,7 +112,7 @@ local sender = jid.join(path, module.host, from_nick); module:log("debug", "message to %s from %s", bare_room, sender); module:log("debug", "body: %s", post_body["text"]); - message = msg({ to = bare_room, from = sender, type = "groupchat", id="webhookbot" .. now()},post_body["text"]); + local message = msg({ to = bare_room, from = sender, type = "groupchat", id="webhookbot" .. now()},post_body["text"]); dest_room:broadcast_message(message, true); return 201; end