comparison mod_firewall/mod_firewall.lua @ 6386:547feb8181eb

mod_firewall: Use util.time instead of prosody.util.time, for 0.12 compatibility
author Link Mauve <linkmauve@linkmauve.fr>
date Sun, 01 Feb 2026 14:09:14 +0100
parents 81f06628fea4
children b15601203d0d
comparison
equal deleted inserted replaced
6385:75838904791e 6386:547feb8181eb
202 for field in what:gmatch("%a+") do 202 for field in what:gmatch("%a+") do
203 table.insert(defs, ("local current_%s = current_date_time.%s;"):format(field, field)); 203 table.insert(defs, ("local current_%s = current_date_time.%s;"):format(field, field));
204 end 204 end
205 return table.concat(defs, " "); 205 return table.concat(defs, " ");
206 end, depends = { "date_time" }; }; 206 end, depends = { "date_time" }; };
207 timestamp = { global_code = [[local get_time = require "prosody.util.time".now;]]; local_code = [[local current_timestamp = get_time();]]; }; 207 timestamp = { global_code = [[local get_time = require "util.time".now;]]; local_code = [[local current_timestamp = get_time();]]; };
208 globalthrottle = { 208 globalthrottle = {
209 global_code = function (throttle) 209 global_code = function (throttle)
210 assert(idsafe(throttle), "Invalid rate limit name: "..throttle); 210 assert(idsafe(throttle), "Invalid rate limit name: "..throttle);
211 assert(active_definitions.RATE[throttle], "Unknown rate limit: "..throttle); 211 assert(active_definitions.RATE[throttle], "Unknown rate limit: "..throttle);
212 return ("local global_throttle_%s = rates.%s:single();"):format(throttle, throttle); 212 return ("local global_throttle_%s = rates.%s:single();"):format(throttle, throttle);