diff mod_pubsub_text_interface/mod_pubsub_text_interface.lua @ 3249:8f4a7084c466

mod_pubsub_text_interface: Rename variable to avoid name clash [luacheck]
author Kim Alvefur <zash@zash.se>
date Mon, 20 Aug 2018 23:18:43 +0200
parents ecec46f7d020
children 5801b5cf8f54
line wrap: on
line diff
--- a/mod_pubsub_text_interface/mod_pubsub_text_interface.lua	Mon Aug 20 22:58:30 2018 +0200
+++ b/mod_pubsub_text_interface/mod_pubsub_text_interface.lua	Mon Aug 20 23:18:43 2018 +0200
@@ -26,7 +26,7 @@
 	local reply = st.reply(stanza);
 	reply.attr.id = id.medium();
 
-	local command, node = body:match("^(%a+)%s+(.*)");
+	local command, node_arg = body:match("^(%a+)%s+(.*)");
 
 	if body == "help" then
 		reply:body(help);
@@ -42,10 +42,10 @@
 			reply:body(nodes);
 		end
 	elseif command == "subscribe" then
-		local ok, err = pubsub:add_subscription(node, from, jid.bare(from), { ["pubsub#include_body"] = true });
+		local ok, err = pubsub:add_subscription(node_arg, from, jid.bare(from), { ["pubsub#include_body"] = true });
 		reply:body(ok and "OK" or err);
 	elseif command == "unsubscribe" then
-		local ok, err = pubsub:remove_subscription(node, from, jid.bare(from));
+		local ok, err = pubsub:remove_subscription(node_arg, from, jid.bare(from));
 		reply:body(ok and "OK" or err);
 	else
 		reply:body("Unknown command. `help` to list commands.");