Software /
code /
prosody
Comparison
plugins/mod_muc.lua @ 937:40ccaacb2000
Added: MUC: Room invites
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Mon, 30 Mar 2009 04:39:12 +0500 |
parent | 896:2c0b9e3c11c3 |
child | 965:8bc06338aac3 |
comparison
equal
deleted
inserted
replaced
936:5663db788fdf | 937:40ccaacb2000 |
---|---|
367 handle_to_occupant(origin, stanza); | 367 handle_to_occupant(origin, stanza); |
368 stanza.attr.to = to; | 368 stanza.attr.to = to; |
369 elseif type ~= "error" and type ~= "result" then | 369 elseif type ~= "error" and type ~= "result" then |
370 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); | 370 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); |
371 end | 371 end |
372 elseif stanza.name == "message" and not stanza.attr.type and #stanza.tags == 1 and jid_nick:get(stanza.attr.from, stanza.attr.to) | |
373 and stanza.tags[1].name == "x" and stanza.tags[1].attr.xmlns == "http://jabber.org/protocol/muc#user" and #stanza.tags[1].tags == 1 | |
374 and stanza.tags[1].tags[1].name == "invite" and stanza.tags[1].tags[1].attr.to then | |
375 local _from, _to = stanza.attr.from, stanza.attr.to; | |
376 local _invitee = stanza.tags[1].tags[1].attr.to; | |
377 stanza.attr.from, stanza.attr.to = _to, _invitee; | |
378 stanza.tags[1].tags[1].attr.from, stanza.tags[1].tags[1].attr.to = _from, nil; | |
379 core_route_stanza(component, stanza); | |
380 stanza.tags[1].tags[1].attr.from, stanza.tags[1].tags[1].attr.to = nil, _invitee; | |
381 stanza.attr.from, stanza.attr.to = _from, _to; | |
372 else | 382 else |
373 if type == "error" or type == "result" then return; end | 383 if type == "error" or type == "result" then return; end |
374 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); | 384 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); |
375 end | 385 end |
376 end | 386 end |