# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1707652253 -3600
# Node ID 866a49f5aa61327d3a89b0e99df3879c76e4e81d
# Parent  58df53eefa2884b34a2544263f2b934a16695d59
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

diff -r 58df53eefa28 -r 866a49f5aa61 mod_firewall/mod_firewall.lua
--- a/mod_firewall/mod_firewall.lua	Wed Feb 07 11:57:30 2024 +0000
+++ b/mod_firewall/mod_firewall.lua	Sun Feb 11 12:50:53 2024 +0100
@@ -612,7 +612,7 @@
 local function resolve_script_path(script_path)
 	local relative_to = prosody.paths.config;
 	if script_path:match("^module:") then
-		relative_to = module.path:sub(1, -#("/mod_"..module.name..".lua"));
+		relative_to = module:get_directory();
 		script_path = script_path:match("^module:(.+)$");
 	end
 	return resolve_relative_path(relative_to, script_path);