From 847376924e0ca5d2cf16aa9c827184ef199d3d6d Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 2 Dec 2016 16:18:22 +0100 Subject: [PATCH] Add password support in muc_subscribe (#1306) --- src/mod_muc_room.erl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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