MUC: Rename variables to please luacheck
authorKim Alvefur <zash@zash.se>
Wed, 20 Jan 2016 13:46:06 +0000 (14:46 +0100)
committerKim Alvefur <zash@zash.se>
Wed, 20 Jan 2016 13:46:06 +0000 (14:46 +0100)
plugins/muc/history.lib.lua
plugins/muc/members_only.lib.lua
plugins/muc/mod_muc.lua
plugins/muc/occupant.lib.lua

index 65b1a31f32291b813f46637524824d0eedacac18..6fdef96f04c55cafaf890373ce61c98ae84fd91c 100644 (file)
@@ -105,7 +105,7 @@ module:hook("muc-get-history", function(event)
        end
 
        local i = history_len-n+1
-       function event:next_stanza()
+       function event.next_stanza()
                if i > history_len then return nil end
                local entry = history[i];
                local msg = entry.stanza;
index 5e29a68d9eba821916d7f23e78212ec55457ec73..d6388fc6a515ed48583fd3aa0b502bf241234938 100644 (file)
@@ -10,7 +10,7 @@
 local st = require "util.stanza";
 
 local muc_util = module:require "muc/util";
-local valid_roles, valid_affiliations = muc_util.valid_roles, muc_util.valid_affiliations;
+local valid_affiliations = muc_util.valid_affiliations;
 
 local function get_members_only(room)
        return room._data.members_only;
@@ -29,7 +29,7 @@ local function set_members_only(room, members_only)
                as well as any remaining occupants.
                ]]
                local occupants_changed = {};
-               for nick, occupant in room:each_occupant() do
+               for _, occupant in room:each_occupant() do
                        local affiliation = room:get_affiliation(occupant.bare_jid);
                        if valid_affiliations[affiliation or "none"] <= valid_affiliations.none then
                                occupant.role = nil;
index 16727f268d794a27c085124919eb94bb2c7cd734..4f5831a62c24e447efced881bf25eb72a0c9201f 100644 (file)
@@ -13,7 +13,7 @@ end
 local muclib = module:require "muc";
 room_mt = muclib.room_mt; -- Yes, global.
 
-local affiliation_notify = module:require "muc/affiliation_notify";
+local affiliation_notify = module:require "muc/affiliation_notify"; -- luacheck: ignore 211
 
 local name = module:require "muc/name";
 room_mt.get_name = name.get;
@@ -102,7 +102,7 @@ local function room_save(room, forced)
        local is_persistent = persistent.get(room);
        persistent_rooms:set(nil, room.jid, is_persistent);
        if is_persistent then
-               local history = room._data.history;
+               local room_history = room._data.history;
                room._data.history = nil;
                local data = {
                        jid = room.jid;
@@ -110,7 +110,7 @@ local function room_save(room, forced)
                        _affiliations = room._affiliations;
                };
                room_configs:set(node, data);
-               room._data.history = history;
+               room._data.history = room_history;
        elseif forced then
                room_configs:set(node, nil);
                if not next(room._occupants) then -- Room empty
@@ -294,8 +294,8 @@ do -- Ad-hoc commands
        end, function(fields, errors)
                if errors then
                        local errmsg = {};
-                       for name, err in pairs(errors) do
-                               errmsg[#errmsg + 1] = name .. ": " .. err;
+                       for field, err in pairs(errors) do
+                               errmsg[#errmsg + 1] = field .. ": " .. err;
                        end
                        return { status = "completed", error = { message = t_concat(errmsg, "\n") } };
                end
index d59252e2824c69f3ea70b2b207a69f2f513462eb..8fe4bbdf12b5f19c2c1d45d82a86b4dbadd74cb9 100644 (file)
@@ -1,4 +1,3 @@
-local next = next;
 local pairs = pairs;
 local setmetatable = setmetatable;
 local st = require "util.stanza";