changeset 6557:2d916ba3253c

mod_firewall: marks: Fix shell commands
author Matthew Wild <mwild1@gmail.com>
date Sun, 24 May 2026 20:04:03 +0100
parents 7477e97a9045
children 15a7749c7acb
files mod_firewall/marks.lib.lua
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_firewall/marks.lib.lua	Sun May 24 20:03:20 2026 +0100
+++ b/mod_firewall/marks.lib.lua	Sun May 24 20:04:03 2026 +0100
@@ -1,3 +1,5 @@
+local jid = require "prosody.util.jid";
+
 local mark_storage = module:open_store("firewall_marks", "keyval+");
 
 local user_sessions = prosody.hosts[module.host].sessions;
@@ -58,7 +60,7 @@
 	host_selector = "user_jid";
 	handler = function(self, user_jid, mark_name) --luacheck: ignore 212/self 212/host
 		local username, host = jid.split(user_jid);
-		if not username or not hosts[host] then
+		if not username or not prosody.hosts[host] then
 			return nil, "Invalid JID supplied";
 		elseif not idsafe(mark_name) then
 			return nil, "Invalid characters in mark name";
@@ -125,7 +127,7 @@
 			return users[a] < users[b];
 		end);
 		for _, username in ipairs(usernames) do
-			self.session.print(username, os.date("%Y-%m-%d %R:%s", users[username]);
+			self.session.print(username, os.date("%Y-%m-%d %R:%s", users[username]));
 		end
 		return true, ("Showing %d users"):format(#usernames);
 	end;