diff options
author | Kim Alvefur <zash@zash.se> | 2015-12-06 02:07:15 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2015-12-06 02:07:15 +0100 |
commit | e3f5e38ccb34f646af4f02c5c6e9c86539d88013 (patch) | |
tree | 14a9c1626a794b2b8e3eded75b0311abf1c8d9bf | |
parent | 224a307f65dd679e6321eb2f0bb966b6311a408a (diff) | |
download | prosody-e3f5e38ccb34f646af4f02c5c6e9c86539d88013.tar.gz prosody-e3f5e38ccb34f646af4f02c5c6e9c86539d88013.zip |
mod_blocklist: Rename variable for clarity
-rw-r--r-- | plugins/mod_blocklist.lua | 10 |
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 |