projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cfa9ea9
)
plugins/muc/muc.lib: Add decline event for parity with invite
author
daurnimator
<quae@daurnimator.com>
Thu, 20 Mar 2014 19:50:29 +0000
(15:50 -0400)
committer
daurnimator
<quae@daurnimator.com>
Thu, 20 Mar 2014 19:50:29 +0000
(15:50 -0400)
plugins/muc/muc.lib.lua
patch
|
blob
|
history
diff --git
a/plugins/muc/muc.lib.lua
b/plugins/muc/muc.lib.lua
index af9bd162816adfcf722b123a1f613d5c20dbbec6..7f8cc016ed8fb23d6d69481c9e23e3179b431bd1 100644
(file)
--- 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();
: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"));
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
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
function room_mt:handle_message_to_room(origin, stanza)
local type = stanza.attr.type;
if type == "groupchat" then