# HG changeset patch # User daurnimator # Date 1395345029 14400 # Node ID 8dd0c6145603f2e64ec191ba7c335a4eb420d1b5 # Parent c95d9132592a32a403e876dc8a1a3ed5af0cdf28 plugins/muc/muc.lib: Add decline event for parity with invite diff -r c95d9132592a -r 8dd0c6145603 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Thu Mar 20 15:22:02 2014 -0400 +++ b/plugins/muc/muc.lib.lua Thu Mar 20 15:50:29 2014 -0400 @@ -1064,7 +1064,7 @@ :tag('body') -- Add a plain message for clients which don't support declines :text(from..' declined your invite to the room '..to..(reason and (' ('..reason..')') or "")) :up(); - self:_route_stanza(decline); + module:fire_event("muc-decline", { room = self, stanza = decline, origin = origin, incoming = stanza }); return true; else origin.send(st.error_reply(stanza, "cancel", "jid-malformed")); @@ -1072,6 +1072,11 @@ end end +module:hook("muc-decline", function(event) + event.room:_route_stanza(event.stanza); + return true; +end, -1) + function room_mt:handle_message_to_room(origin, stanza) local type = stanza.attr.type; if type == "groupchat" then