Mercurial > prosody-modules
diff mod_firewall/mod_firewall.lua @ 6535:82b6a03b9dfa
mod_firewall: Remove obsolete and broken mark/unmark commands
Replaced by flags
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Mon, 11 May 2026 13:16:18 +0100 |
| parents | 5aeefc2251d4 |
| children | 24c34968dd45 |
line wrap: on
line diff
--- a/mod_firewall/mod_firewall.lua Wed May 06 16:15:38 2026 +0100 +++ b/mod_firewall/mod_firewall.lua Mon May 11 13:16:18 2026 +0100 @@ -849,43 +849,3 @@ print("end -- End of file "..filename); end end - - --- Console - -local console_env = module:shared("/*/admin_shell/env"); - -console_env.firewall = {}; - -function console_env.firewall:mark(user_jid, mark_name) - local username, host = jid.split(user_jid); - if not username or not hosts[host] then - return nil, "Invalid JID supplied"; - elseif not idsafe(mark_name) then - return nil, "Invalid characters in mark name"; - end - if not module:context(host):fire_event("firewall/marked/user", { - username = session.username; - mark = mark_name; - timestamp = os.time(); - }) then - return nil, "Mark not set - is mod_firewall loaded on that host?"; - end - return true, "User marked"; -end - -function console_env.firewall:unmark(jid, mark_name) - local username, host = jid.split(user_jid); - if not username or not hosts[host] then - return nil, "Invalid JID supplied"; - elseif not idsafe(mark_name) then - return nil, "Invalid characters in mark name"; - end - if not module:context(host):fire_event("firewall/unmarked/user", { - username = session.username; - mark = mark_name; - }) then - return nil, "Mark not removed - is mod_firewall loaded on that host?"; - end - return true, "User unmarked"; -end
