Changeset

7086:6cc7c9da29ed

MUC: Rename variables to please luacheck
author Kim Alvefur <zash@zash.se>
date Wed, 20 Jan 2016 14:46:06 +0100
parents 7085:343be83ddfa6
children 7088:85e72077d40b
files plugins/muc/history.lib.lua plugins/muc/members_only.lib.lua plugins/muc/mod_muc.lua plugins/muc/occupant.lib.lua
diffstat 4 files changed, 8 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/history.lib.lua	Sat Jan 16 22:44:43 2016 +0100
+++ b/plugins/muc/history.lib.lua	Wed Jan 20 14:46:06 2016 +0100
@@ -105,7 +105,7 @@
 	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;
--- a/plugins/muc/members_only.lib.lua	Sat Jan 16 22:44:43 2016 +0100
+++ b/plugins/muc/members_only.lib.lua	Wed Jan 20 14:46:06 2016 +0100
@@ -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 @@
 		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;
--- a/plugins/muc/mod_muc.lua	Sat Jan 16 22:44:43 2016 +0100
+++ b/plugins/muc/mod_muc.lua	Wed Jan 20 14:46:06 2016 +0100
@@ -13,7 +13,7 @@
 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 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 @@
 			_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 @@
 	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
--- a/plugins/muc/occupant.lib.lua	Sat Jan 16 22:44:43 2016 +0100
+++ b/plugins/muc/occupant.lib.lua	Wed Jan 20 14:46:06 2016 +0100
@@ -1,4 +1,3 @@
-local next = next;
 local pairs = pairs;
 local setmetatable = setmetatable;
 local st = require "util.stanza";