Mercurial > prosody-hg
diff plugins/muc/password.lib.lua @ 9455:c62c983b8be3
MUC: Check that a room password is set before verifying password supplied by user
| author | Michel Le Bihan <michel@lebihan.pl> |
|---|---|
| date | Tue, 09 Oct 2018 18:42:19 +0200 |
| parents | 173c0e16e704 |
| children | b5fd1637f15c |
line wrap: on
line diff
--- a/plugins/muc/password.lib.lua Tue Oct 09 15:02:44 2018 +0100 +++ b/plugins/muc/password.lib.lua Tue Oct 09 18:42:19 2018 +0200 @@ -42,6 +42,7 @@ -- Don't allow anyone to join room unless they provide the password module:hook("muc-occupant-pre-join", function(event) local room, stanza = event.room, event.stanza; + if not get_password(room) then return end local muc_x = stanza:get_child("x", "http://jabber.org/protocol/muc"); if not muc_x then return end local password = muc_x:get_child_text("password", "http://jabber.org/protocol/muc");
