diff options
author | daurnimator <quae@daurnimator.com> | 2014-03-19 17:33:32 -0400 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2014-03-19 17:33:32 -0400 |
commit | 0fc61fbaad4abf9d600c731e50bb9a414d6345d8 (patch) | |
tree | ef7d7924178deb66851d06796d0767558f222dfe /plugins | |
parent | fd4a486166f340c736f15636ff5dc3940a806995 (diff) | |
download | prosody-0fc61fbaad4abf9d600c731e50bb9a414d6345d8.tar.gz prosody-0fc61fbaad4abf9d600c731e50bb9a414d6345d8.zip |
plugins/muc/muc.lib: Send invite out from event: removes '-prepared' from event name
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/muc/muc.lib.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 7b010646..7cc1beb4 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -1011,8 +1011,7 @@ function room_mt:handle_mediated_invite(origin, stanza) :tag('body') -- Add a plain message for clients which don't support invites :text(_from..' invited you to the room '.._to..(_reason and (' ('.._reason..')') or "")) :up(); - module:fire_event("muc-invite-prepared", { room = self, stanza = invite }) - self:_route_stanza(invite); + module:fire_event("muc-invite", { room = self, stanza = invite, origin = origin, incoming = stanza }); return true; else origin.send(st.error_reply(stanza, "cancel", "jid-malformed")); @@ -1020,8 +1019,13 @@ function room_mt:handle_mediated_invite(origin, stanza) end end +module:hook("muc-invite", function(event) + event.room:_route_stanza(event.stanza); + return true; +end, -1) + -- When an invite is sent; add an affiliation for the invitee -module:hook("muc-invite-prepared", function(event) +module:hook("muc-invite", function(event) local room, stanza = event.room, event.stanza local invitee = stanza.attr.to if room:get_members_only() and not room:get_affiliation(invitee) then |