Comparison

plugins/mod_admin_adhoc.lua @ 9399:ec60e74fd9bb

mod_admin_adhoc: Remove unused loop variables [luacheck]
author Kim Alvefur <zash@zash.se>
date Sun, 30 Sep 2018 13:37:51 +0200
parent 9086:74b4be5afb74
child 9400:9ef746c2a644
comparison
equal deleted inserted replaced
9398:7f8ba13b4dd6 9399:ec60e74fd9bb
293 local get_user_stats_handler = adhoc_simple(get_user_stats_layout, function(fields, err) 293 local get_user_stats_handler = adhoc_simple(get_user_stats_layout, function(fields, err)
294 if err then 294 if err then
295 return generate_error_message(err); 295 return generate_error_message(err);
296 end 296 end
297 297
298 local user, host, resource = jid.split(fields.accountjid); 298 local user, host = jid.split(fields.accountjid);
299 if host ~= module_host then 299 if host ~= module_host then
300 return { status = "completed", error = { message = "Tried to get stats for a user on " .. host .. " but command was sent to " .. module_host } }; 300 return { status = "completed", error = { message = "Tried to get stats for a user on " .. host .. " but command was sent to " .. module_host } };
301 elseif not usermanager_user_exists(user, host) then 301 elseif not usermanager_user_exists(user, host) then
302 return { status = "completed", error = { message = "User does not exist" } }; 302 return { status = "completed", error = { message = "User does not exist" } };
303 end 303 end
592 end 592 end
593 is_global = true; 593 is_global = true;
594 end 594 end
595 595
596 local ok_list, err_list = {}, {}; 596 local ok_list, err_list = {}, {};
597 for host_name, host in pairs(hosts) do 597 for host_name in pairs(hosts) do
598 if modulemanager.is_loaded(host_name, fields.module) then 598 if modulemanager.is_loaded(host_name, fields.module) then
599 local ok, err = modulemanager.reload(host_name, fields.module); 599 local ok, err = modulemanager.reload(host_name, fields.module);
600 if ok then 600 if ok then
601 ok_list[#ok_list + 1] = host_name; 601 ok_list[#ok_list + 1] = host_name;
602 else 602 else
737 end 737 end
738 is_global = true; 738 is_global = true;
739 end 739 end
740 740
741 local ok_list, err_list = {}, {}; 741 local ok_list, err_list = {}, {};
742 for host_name, host in pairs(hosts) do 742 for host_name in pairs(hosts) do
743 if modulemanager.is_loaded(host_name, fields.module) then 743 if modulemanager.is_loaded(host_name, fields.module) then
744 local ok, err = modulemanager.unload(host_name, fields.module); 744 local ok, err = modulemanager.unload(host_name, fields.module);
745 if ok then 745 if ok then
746 ok_list[#ok_list + 1] = host_name; 746 ok_list[#ok_list + 1] = host_name;
747 else 747 else