430 self:_route_stanza(pr:tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) |
430 self:_route_stanza(pr:tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) |
431 :tag("item", {affiliation=affiliation or "none", role=role or "none"}):up() |
431 :tag("item", {affiliation=affiliation or "none", role=role or "none"}):up() |
432 :tag("status", {code='110'})); |
432 :tag("status", {code='110'})); |
433 end |
433 end |
434 self:send_history(from, stanza); |
434 self:send_history(from, stanza); |
|
435 elseif not affiliation then -- registration required for entering members-only room |
|
436 local reply = st.error_reply(stanza, "auth", "registration-required"):up(); |
|
437 reply.tags[1].attr.code = "407"; |
|
438 origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); |
435 else -- banned |
439 else -- banned |
436 local reply = st.error_reply(stanza, "auth", "forbidden"):up(); |
440 local reply = st.error_reply(stanza, "auth", "forbidden"):up(); |
437 reply.tags[1].attr.code = "403"; |
441 reply.tags[1].attr.code = "403"; |
438 origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); |
442 origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); |
439 end |
443 end |