Software / code / prosody
Comparison
plugins/muc/muc.lib.lua @ 2978:5760074dc7d4
MUC: Include <status code='100'/> in a message, not in presence. Fixes various issues.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Mon, 19 Apr 2010 18:30:59 +0500 |
| parent | 2925:692b3c6c5bd2 |
| child | 2984:3094166cfdd5 |
comparison
equal
deleted
inserted
replaced
| 2977:686f9a5a7f5e | 2978:5760074dc7d4 |
|---|---|
| 316 else | 316 else |
| 317 pr.attr.to = from; | 317 pr.attr.to = from; |
| 318 self:_route_stanza(pr:tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) | 318 self:_route_stanza(pr:tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) |
| 319 :tag("item", {affiliation=affiliation or "none", role=role or "none"}):up() | 319 :tag("item", {affiliation=affiliation or "none", role=role or "none"}):up() |
| 320 :tag("status", {code='110'})); | 320 :tag("status", {code='110'})); |
| 321 end | |
| 322 if self._data.whois == 'anyone' then -- non-anonymous? | |
| 323 self:_route_stanza(st.stanza("message", {from=to, to=from, type='groupchat'}) | |
| 324 :tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) | |
| 325 :tag("status", {code='100'})); | |
| 321 end | 326 end |
| 322 self:send_history(from); | 327 self:send_history(from); |
| 323 else -- banned | 328 else -- banned |
| 324 local reply = st.error_reply(stanza, "auth", "forbidden"):up(); | 329 local reply = st.error_reply(stanza, "auth", "forbidden"):up(); |
| 325 reply.tags[1].attr.code = "403"; | 330 reply.tags[1].attr.code = "403"; |
| 797 else | 802 else |
| 798 item.attr.jid = from_occupant.jid; | 803 item.attr.jid = from_occupant.jid; |
| 799 end | 804 end |
| 800 end | 805 end |
| 801 end | 806 end |
| 802 if self._data.whois == 'anyone' then | |
| 803 muc_child:tag('status', { code = '100' }); | |
| 804 end | |
| 805 end | 807 end |
| 806 self:route_stanza(stanza); | 808 self:route_stanza(stanza); |
| 807 if muc_child then | 809 if muc_child then |
| 808 for _, item in pairs(muc_child.tags) do | 810 for _, item in pairs(muc_child.tags) do |
| 809 if item.name == "item" then | 811 if item.name == "item" then |