24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-02 21:17:12 +02:00

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

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