Comparison

mod_firewall/conditions.lib.lua @ 2554:19bb4606013f

mod_firewall: Fix everything wrong with SENT_DIRECTED_PRESENCE_TO_SENDER
author Matthew Wild <mwild1@gmail.com>
date Thu, 23 Feb 2017 14:11:31 +0000
parent 2553:7ed2a66bfabd
child 2555:a9eb4d5566f3
comparison
equal deleted inserted replaced
2553:7ed2a66bfabd 2554:19bb4606013f
261 return ("(current_timestamp - (session.firewall_marked_%s or 0)) < %d"):format(idsafe(name), tonumber(time)), { "timestamp" }; 261 return ("(current_timestamp - (session.firewall_marked_%s or 0)) < %d"):format(idsafe(name), tonumber(time)), { "timestamp" };
262 end 262 end
263 return ("not not session.firewall_marked_"..idsafe(name)); 263 return ("not not session.firewall_marked_"..idsafe(name));
264 end 264 end
265 265
266 function condition_handlers.SENT_DIRECTED_PRESENCE_TO_SENDER(jid) 266 function condition_handlers.SENT_DIRECTED_PRESENCE_TO_SENDER()
267 local meta_deps = {}; 267 return "not not session.directed[from]", { "from" };
268 jid = meta(("%q"):format(jid), meta_deps);
269 return "not not session.directed[jid]", meta_deps;
270 end 268 end
271 269
272 -- CHECK LIST: spammers contains $<@from> 270 -- CHECK LIST: spammers contains $<@from>
273 function condition_handlers.CHECK_LIST(list_condition) 271 function condition_handlers.CHECK_LIST(list_condition)
274 local list_name, expr = list_condition:match("(%S+) contains (.+)$"); 272 local list_name, expr = list_condition:match("(%S+) contains (.+)$");