aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-08-03 21:07:00 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-08-03 21:07:00 +0500
commit683109cd9e634ca8b5caeb61a8aa8f69cf15ca07 (patch)
tree297094e0b039750cd7279b041460afe80130a630 /plugins/muc
parent0efcfb0a8ab0678b037f5a2c2b8aced354f51166 (diff)
downloadprosody-683109cd9e634ca8b5caeb61a8aa8f69cf15ca07.tar.gz
prosody-683109cd9e634ca8b5caeb61a8aa8f69cf15ca07.zip
MUC: Return correct error to non-members attempting to enter a members-only room.
Diffstat (limited to 'plugins/muc')
-rw-r--r--plugins/muc/muc.lib.lua4
1 files changed, 4 insertions, 0 deletions
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";