aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_blocklist.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-12-08 18:06:18 +0100
committerKim Alvefur <zash@zash.se>2016-12-08 18:06:18 +0100
commitd68051abe4de30d6b1ea196b1812a276e6acb61a (patch)
tree30dbbd1add5ff5aeaab557ed39309728a06f8cf6 /plugins/mod_blocklist.lua
parent8945f8cba1aac03016b0e8449ba37a99a3b43264 (diff)
downloadprosody-d68051abe4de30d6b1ea196b1812a276e6acb61a.tar.gz
prosody-d68051abe4de30d6b1ea196b1812a276e6acb61a.zip
mod_blocklist: Simplify loop with ipairs
Diffstat (limited to 'plugins/mod_blocklist.lua')
-rw-r--r--plugins/mod_blocklist.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/plugins/mod_blocklist.lua b/plugins/mod_blocklist.lua
index f5198108..2233045e 100644
--- a/plugins/mod_blocklist.lua
+++ b/plugins/mod_blocklist.lua
@@ -62,11 +62,9 @@ local function migrate_privacy_list(username)
local migrated_data = { [false] = { created = os.time(); migrated = "privacy" }};
module:log("info", "Migrating blocklist from mod_privacy storage for user '%s'", username);
- local item, jid;
- for i = 1, #legacy_data do
- item = legacy_data[i];
+ for _, item in ipairs(default_list.items) do
if item.type == "jid" and item.action == "deny" then
- jid = jid_prep(item.value);
+ local jid = jid_prep(item.value);
if not jid then
module:log("warn", "Invalid JID in privacy store for user '%s' not migrated: %s", username, tostring(item.value));
else