aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_blocklist.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mod_blocklist.lua')
-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