From 1de71a88b9f0b705474e6f89f08711229adc447b Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Mon, 30 Mar 2009 04:39:12 +0500 Subject: Added: MUC: Room invites --- plugins/mod_muc.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/mod_muc.lua b/plugins/mod_muc.lua index f4c17546..117a044b 100644 --- a/plugins/mod_muc.lua +++ b/plugins/mod_muc.lua @@ -369,6 +369,16 @@ function handle_to_room(origin, stanza) -- presence changes and groupchat messag elseif type ~= "error" and type ~= "result" then origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); end + elseif stanza.name == "message" and not stanza.attr.type and #stanza.tags == 1 and jid_nick:get(stanza.attr.from, stanza.attr.to) + and stanza.tags[1].name == "x" and stanza.tags[1].attr.xmlns == "http://jabber.org/protocol/muc#user" and #stanza.tags[1].tags == 1 + and stanza.tags[1].tags[1].name == "invite" and stanza.tags[1].tags[1].attr.to then + local _from, _to = stanza.attr.from, stanza.attr.to; + local _invitee = stanza.tags[1].tags[1].attr.to; + stanza.attr.from, stanza.attr.to = _to, _invitee; + stanza.tags[1].tags[1].attr.from, stanza.tags[1].tags[1].attr.to = _from, nil; + core_route_stanza(component, stanza); + stanza.tags[1].tags[1].attr.from, stanza.tags[1].tags[1].attr.to = nil, _invitee; + stanza.attr.from, stanza.attr.to = _from, _to; else if type == "error" or type == "result" then return; end origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); -- cgit v1.2.3