Mercurial > prosody-modules
comparison mod_firewall/mod_firewall.lua @ 5834:866a49f5aa61
mod_firewall: Fix to find scripts when installed with plugin installer
Extra resources are stored in a different path by luarocks, not
alongside the code as this code assumed.
Thanks eTaurus
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 11 Feb 2024 12:50:53 +0100 |
parents | e304e19536f2 |
children | 1d1eadff331d |
comparison
equal
deleted
inserted
replaced
5833:58df53eefa28 | 5834:866a49f5aa61 |
---|---|
610 end | 610 end |
611 | 611 |
612 local function resolve_script_path(script_path) | 612 local function resolve_script_path(script_path) |
613 local relative_to = prosody.paths.config; | 613 local relative_to = prosody.paths.config; |
614 if script_path:match("^module:") then | 614 if script_path:match("^module:") then |
615 relative_to = module.path:sub(1, -#("/mod_"..module.name..".lua")); | 615 relative_to = module:get_directory(); |
616 script_path = script_path:match("^module:(.+)$"); | 616 script_path = script_path:match("^module:(.+)$"); |
617 end | 617 end |
618 return resolve_relative_path(relative_to, script_path); | 618 return resolve_relative_path(relative_to, script_path); |
619 end | 619 end |
620 | 620 |