aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/muc.lib.lua
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2014-03-20 15:50:29 -0400
committerdaurnimator <quae@daurnimator.com>2014-03-20 15:50:29 -0400
commit1798efadbd1ff13485794cd8e8be31d83fea169a (patch)
tree0c46a4447cd3768219ef54eda1953bbbb994b3da /plugins/muc/muc.lib.lua
parent4b1e0493b74fa0674f550f5148aeba5cf116e269 (diff)
downloadprosody-1798efadbd1ff13485794cd8e8be31d83fea169a.tar.gz
prosody-1798efadbd1ff13485794cd8e8be31d83fea169a.zip
plugins/muc/muc.lib: Add decline event for parity with invite
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r--plugins/muc/muc.lib.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index af9bd162..7f8cc016 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -1064,7 +1064,7 @@ function room_mt:handle_mediated_decline(origin, stanza)
: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 @@ function room_mt:handle_mediated_decline(origin, stanza)
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