# HG changeset patch # User Matthew Wild # Date 1326593141 0 # Node ID 14f39769c9e0f8a7ae8c668d915cd738cff1b98d # Parent e50bdbaa7802ac91d422cddf78cb549cd78f2bc2 mod_muc_limits: Echo any MUC or in the error reply (required to make Gajim display the error) diff -r e50bdbaa7802 -r 14f39769c9e0 mod_muc_limits/mod_muc_limits.lua --- a/mod_muc_limits/mod_muc_limits.lua Sun Jan 15 01:40:50 2012 +0000 +++ b/mod_muc_limits/mod_muc_limits.lua Sun Jan 15 02:05:41 2012 +0000 @@ -2,6 +2,8 @@ local st = require "util.stanza"; local new_throttle = require "util.throttle".create; +local xmlns_muc = "http://jabber.org/protocol/muc"; + local period = math.max(module:get_option_number("muc_event_rate", 0.5), 0); local burst = math.max(module:get_option_number("muc_burst_factor", 6), 1); @@ -26,7 +28,16 @@ end if not throttle:poll(1) then module:log("warn", "Dropping stanza for %s@%s from %s, over rate limit", dest_room, dest_host, from_jid); - origin.send(st.error_reply(stanza, "wait", "policy-violation", "The room is currently overactive, please try again later")); + local reply = st.error_reply(stanza, "wait", "policy-violation", "The room is currently overactive, please try again later"); + local body = stanza:get_child_text("body"); + if body then + reply:up():tag("body"):text(body):up(); + end + local x = stanza:get_child("x", xmlns_muc); + if x then + reply:add_child(st.clone(x)); + end + origin.send(reply); return true; end end