Software / code / prosody
Comparison
plugins/muc/muc.lib.lua @ 5241:4516e6bd51b4
MUC: Support invite messages when stanza type is explicitly set to "normal" or to an unknown value.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Sat, 15 Dec 2012 07:08:54 +0500 |
| parent | 5195:ce5d7538ac48 |
| child | 5294:87f07dd0bbfb |
comparison
equal
deleted
inserted
replaced
| 5240:864b27ddaa10 | 5241:4516e6bd51b4 |
|---|---|
| 912 self:handle_to_occupant(origin, stanza); | 912 self:handle_to_occupant(origin, stanza); |
| 913 stanza.attr.to = to; | 913 stanza.attr.to = to; |
| 914 elseif type ~= "error" and type ~= "result" then | 914 elseif type ~= "error" and type ~= "result" then |
| 915 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); | 915 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); |
| 916 end | 916 end |
| 917 elseif stanza.name == "message" and not stanza.attr.type and #stanza.tags == 1 and self._jid_nick[stanza.attr.from] | 917 elseif stanza.name == "message" and not(type == "chat" or type == "error" or type == "groupchat" or type == "headline") and #stanza.tags == 1 |
| 918 and stanza.tags[1].name == "x" and stanza.tags[1].attr.xmlns == "http://jabber.org/protocol/muc#user" then | 918 and self._jid_nick[stanza.attr.from] and stanza.tags[1].name == "x" and stanza.tags[1].attr.xmlns == "http://jabber.org/protocol/muc#user" then |
| 919 local x = stanza.tags[1]; | 919 local x = stanza.tags[1]; |
| 920 local payload = (#x.tags == 1 and x.tags[1]); | 920 local payload = (#x.tags == 1 and x.tags[1]); |
| 921 if payload and payload.name == "invite" and payload.attr.to then | 921 if payload and payload.name == "invite" and payload.attr.to then |
| 922 local _from, _to = stanza.attr.from, stanza.attr.to; | 922 local _from, _to = stanza.attr.from, stanza.attr.to; |
| 923 local _invitee = jid_prep(payload.attr.to); | 923 local _invitee = jid_prep(payload.attr.to); |