aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-12-06 02:07:15 +0100
committerKim Alvefur <zash@zash.se>2015-12-06 02:07:15 +0100
commit0ec9e20543e2daeadc3bfca1cfc0c3f63e02d65c (patch)
tree14a9c1626a794b2b8e3eded75b0311abf1c8d9bf
parentb2f0349c7e420ab78734ebcc74155fe79a7f6514 (diff)
downloadprosody-0ec9e20543e2daeadc3bfca1cfc0c3f63e02d65c.tar.gz
prosody-0ec9e20543e2daeadc3bfca1cfc0c3f63e02d65c.zip
mod_blocklist: Rename variable for clarity
-rw-r--r--plugins/mod_blocklist.lua10
1 files changed, 5 insertions, 5 deletions
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