aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-01-20 14:46:06 +0100
committerKim Alvefur <zash@zash.se>2016-01-20 14:46:06 +0100
commitacc11c8eb3ed2b827150eed78761007856eb2e36 (patch)
tree84d4ba28d235067a7bfff06e2f863830c8830dfd /plugins/muc
parent48f8c23f4ab0e8400e20101960055eb29c4aa6f7 (diff)
downloadprosody-acc11c8eb3ed2b827150eed78761007856eb2e36.tar.gz
prosody-acc11c8eb3ed2b827150eed78761007856eb2e36.zip
MUC: Rename variables to please luacheck
Diffstat (limited to 'plugins/muc')
-rw-r--r--plugins/muc/history.lib.lua2
-rw-r--r--plugins/muc/members_only.lib.lua4
-rw-r--r--plugins/muc/mod_muc.lua10
-rw-r--r--plugins/muc/occupant.lib.lua1
4 files changed, 8 insertions, 9 deletions
diff --git a/plugins/muc/history.lib.lua b/plugins/muc/history.lib.lua
index 65b1a31f..6fdef96f 100644
--- a/plugins/muc/history.lib.lua
+++ b/plugins/muc/history.lib.lua
@@ -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;
diff --git a/plugins/muc/members_only.lib.lua b/plugins/muc/members_only.lib.lua
index 5e29a68d..d6388fc6 100644
--- a/plugins/muc/members_only.lib.lua
+++ b/plugins/muc/members_only.lib.lua
@@ -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;
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index 16727f26..4f5831a6 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -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
diff --git a/plugins/muc/occupant.lib.lua b/plugins/muc/occupant.lib.lua
index d59252e2..8fe4bbdf 100644
--- a/plugins/muc/occupant.lib.lua
+++ b/plugins/muc/occupant.lib.lua
@@ -1,4 +1,3 @@
-local next = next;
local pairs = pairs;
local setmetatable = setmetatable;
local st = require "util.stanza";