From: Badlop Date: Fri, 2 Dec 2016 15:18:22 +0000 (+0100) Subject: Add password support in muc_subscribe (#1306) X-Git-Tag: 16.12~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=847376924e0ca5d2cf16aa9c827184ef199d3d6d;p=ejabberd Add password support in muc_subscribe (#1306) --- diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index c5c0c0fac..07689db19 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -2024,8 +2024,11 @@ check_captcha(Affiliation, From, StateData) -> -spec extract_password(stanza()) -> binary() | false. extract_password(Packet) -> - case xmpp:get_subtag(Packet, #muc{}) of - #muc{password = Password} when is_binary(Password) -> + case {xmpp:get_subtag(Packet, #muc{}), + xmpp:get_subtag(Packet, #muc_subscribe{})} of + {#muc{password = Password}, _} when is_binary(Password) -> + Password; + {_, #muc_subscribe{password = Password}} when is_binary(Password) -> Password; _ -> false