Changeset

3148:8c7b8b2c3237

mod_slack_webhooks: Add a special webhook target for debugging
author Kim Alvefur <zash@zash.se>
date Sun, 03 Jun 2018 02:18:02 +0200
parents 3147:82689acd1294
children 3149:ccbfe7df02dc
files mod_slack_webhooks/mod_slack_webhooks.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_slack_webhooks/mod_slack_webhooks.lua	Sun Jun 03 02:02:56 2018 +0200
+++ b/mod_slack_webhooks/mod_slack_webhooks.lua	Sun Jun 03 02:18:02 2018 +0200
@@ -90,6 +90,10 @@
 	json_out = json.encode(json_out)
 	local url = routing[from_room];
 	module:log("debug", "message from %s in %s to %s", from_nick, from_room, url);
+	if url == "DEBUG" then
+		module:log("debug", "json_out = %s", json_out);
+		return;
+	end
 	local headers = {
 		["Content-Type"] = "application/json",
 	};