# HG changeset patch # User Kim Alvefur # Date 1458229527 -3600 # Node ID f6dcfe263b85c851ae044dfd15a818b377b8d50d # Parent 5f6c18fd01617dd3a04fe5ddf4ebea397d5daa6b mod_throttle_unsolicited: Mark sessions so they can be matched with 'ORIGIN_MARKED: throttle_unsolicited' by mod_firewall diff -r 5f6c18fd0161 -r f6dcfe263b85 mod_throttle_unsolicited/mod_throttle_unsolicited.lua --- a/mod_throttle_unsolicited/mod_throttle_unsolicited.lua Thu Mar 17 14:45:08 2016 +0100 +++ b/mod_throttle_unsolicited/mod_throttle_unsolicited.lua Thu Mar 17 16:45:27 2016 +0100 @@ -3,6 +3,7 @@ local jid_bare = require "util.jid".bare; local is_contact_subscribed = require "core.rostermanager".is_contact_subscribed; local throttle = require "util.throttle"; +local gettime = require "socket".gettime; local sessions = prosody.full_sessions; @@ -37,6 +38,7 @@ log("debug", "%s is not subscribed to %s@%s", from_jid, to_user, to_host); if not lim:poll(1) then log("warn", "Sent too many messages to non-contacts, bouncing message"); + event.origin.firewall_mark_throttle_unsolicited = gettime(); event.origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); return true; end