From 0ec9e20543e2daeadc3bfca1cfc0c3f63e02d65c Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Sun, 6 Dec 2015 02:07:15 +0100
Subject: mod_blocklist: Rename variable for clarity

---
 plugins/mod_blocklist.lua | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'plugins')

diff --git a/plugins/mod_blocklist.lua b/plugins/mod_blocklist.lua
index e37bc4df..b68c08d1 100644
--- a/plugins/mod_blocklist.lua
+++ b/plugins/mod_blocklist.lua
@@ -123,9 +123,9 @@ local function edit_blocklist(event)
 		new[jid] = is_contact_subscribed(username, module.host, jid) or false;
 	end
 
-	local mode = action.name == "block" or nil;
+	local is_blocking = action.name == "block" or nil; -- nil if unblocking
 
-	if mode and not next(new) then
+	if is_blocking and not next(new) then
 		-- <block/> element does not contain at least one <item/> child element
 		origin.send(st_error_reply(stanza, "modify", "bad-request"));
 		return true;
@@ -135,12 +135,12 @@ local function edit_blocklist(event)
 
 	local new_blocklist = {};
 
-	if mode or next(new) then
+	if is_blocking or next(new) then
 		for jid in pairs(blocklist) do
 			new_blocklist[jid] = true;
 		end
 		for jid in pairs(new) do
-			new_blocklist[jid] = mode;
+			new_blocklist[jid] = is_blocking;
 		end
 		-- else empty the blocklist
 	end
@@ -154,7 +154,7 @@ local function edit_blocklist(event)
 		return true;
 	end
 
-	if mode then
+	if is_blocking then
 		for jid, in_roster in pairs(new) do
 			if not blocklist[jid] and in_roster and sessions[username] then
 				for _, session in pairs(sessions[username].sessions) do
-- 
cgit v1.2.3