aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-03-30 04:39:12 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-03-30 04:39:12 +0500
commit1de71a88b9f0b705474e6f89f08711229adc447b (patch)
tree97a715e9762146480510e44fc60d75ef764471fc /plugins
parent1192c1a1f5e66efdba705424cd54dbebc4203ae3 (diff)
downloadprosody-1de71a88b9f0b705474e6f89f08711229adc447b.tar.gz
prosody-1de71a88b9f0b705474e6f89f08711229adc447b.zip
Added: MUC: Room invites
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_muc.lua10
1 files changed, 10 insertions, 0 deletions
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"));