# HG changeset patch # User Kim Alvefur # Date 1449364035 -3600 # Node ID 828a10e0464be908753bce5b73207da5108b3123 # Parent d90a4d6a0e2c8ad3cc12c21b2e9d7e5aac38dc46 mod_blocklist: Rename variable for clarity diff -r d90a4d6a0e2c -r 828a10e0464b plugins/mod_blocklist.lua --- a/plugins/mod_blocklist.lua Sat Dec 05 22:46:50 2015 +0100 +++ b/plugins/mod_blocklist.lua Sun Dec 06 02:07:15 2015 +0100 @@ -123,9 +123,9 @@ 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 -- element does not contain at least one child element origin.send(st_error_reply(stanza, "modify", "bad-request")); return true; @@ -135,12 +135,12 @@ 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 @@ 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