comparison mod_firewall/conditions.lib.lua @ 2882:6f289283feb1

mod_firewall: Prevent traceback if no directed presence has been sent (fixes #1081)
author Kim Alvefur <zash@zash.se>
date Fri, 16 Feb 2018 07:54:35 +0100
parents 22e11645a895
children 165d2877eeac
comparison
equal deleted inserted replaced
2881:824b0d7fa883 2882:6f289283feb1
275 end 275 end
276 return ("not not session.firewall_marked_"..idsafe(name)); 276 return ("not not session.firewall_marked_"..idsafe(name));
277 end 277 end
278 278
279 function condition_handlers.SENT_DIRECTED_PRESENCE_TO_SENDER() 279 function condition_handlers.SENT_DIRECTED_PRESENCE_TO_SENDER()
280 return "not not session.directed[from]", { "from" }; 280 return "not not (session.directed and session.directed[from])", { "from" };
281 end 281 end
282 282
283 -- TO FULL JID? 283 -- TO FULL JID?
284 function condition_handlers.TO_FULL_JID() 284 function condition_handlers.TO_FULL_JID()
285 return "not not full_sessions[to]", { "to" }; 285 return "not not full_sessions[to]", { "to" };