Add password support in muc_subscribe (#1306)

This commit is contained in:
Badlop 2016-12-02 16:18:22 +01:00
parent d7e1f6d7b3
commit 847376924e
1 changed files with 5 additions and 2 deletions

View File

@ -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