From 683109cd9e634ca8b5caeb61a8aa8f69cf15ca07 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Tue, 3 Aug 2010 21:07:00 +0500 Subject: MUC: Return correct error to non-members attempting to enter a members-only room. --- plugins/muc/muc.lib.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plugins/muc') diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 9cdf4d18..9ac3472f 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -432,6 +432,10 @@ function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc :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"; -- cgit v1.2.3