Software /
code /
prosody
Changeset
3445:2fde9cb97f76
MUC: Return correct error to non-members attempting to enter a members-only room.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 03 Aug 2010 21:07:00 +0500 |
parents | 3444:e6a78e15fed2 |
children | 3446:9c0b3cd890e9 |
files | plugins/muc/muc.lib.lua |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/muc/muc.lib.lua Tue Aug 03 20:05:58 2010 +0500 +++ b/plugins/muc/muc.lib.lua Tue Aug 03 21:07:00 2010 +0500 @@ -432,6 +432,10 @@ :tag("status", {code='110'})); end self:send_history(from, stanza); + elseif not affiliation then -- registration required for entering members-only room + local reply = st.error_reply(stanza, "auth", "registration-required"):up(); + reply.tags[1].attr.code = "407"; + origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); else -- banned local reply = st.error_reply(stanza, "auth", "forbidden"):up(); reply.tags[1].attr.code = "403";