comparison mod_throttle_unsolicited/mod_throttle_unsolicited.lua @ 2361:231d47e61c81

mod_throttle_unsolicited: Use existing local reference to origin
author Kim Alvefur <zash@zash.se>
date Tue, 15 Nov 2016 09:01:03 +0100
parents 1424aa8877f0
children 4d8a68557941
comparison
equal deleted inserted replaced
2360:97e63e8f0f32 2361:231d47e61c81
40 local to_user, to_host = jid_split(to_orig); 40 local to_user, to_host = jid_split(to_orig);
41 if to_user and not is_contact_subscribed(to_user, to_host, from_jid) then 41 if to_user and not is_contact_subscribed(to_user, to_host, from_jid) then
42 log("debug", "%s is not subscribed to %s@%s", from_jid, to_user, to_host); 42 log("debug", "%s is not subscribed to %s@%s", from_jid, to_user, to_host);
43 if not lim:poll(1) then 43 if not lim:poll(1) then
44 log("warn", "Sent too many messages to non-contacts, bouncing message"); 44 log("warn", "Sent too many messages to non-contacts, bouncing message");
45 event.origin.firewall_mark_throttle_unsolicited = gettime(); 45 origin.firewall_mark_throttle_unsolicited = gettime();
46 event.origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); 46 origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
47 return true; 47 return true;
48 end 48 end
49 end 49 end
50 end 50 end
51 51