]> granicus.if.org Git - ejabberd/commitdiff
Add password support in muc_subscribe (#1306)
authorBadlop <badlop@process-one.net>
Fri, 2 Dec 2016 15:18:22 +0000 (16:18 +0100)
committerBadlop <badlop@process-one.net>
Fri, 2 Dec 2016 15:18:35 +0000 (16:18 +0100)
src/mod_muc_room.erl

index c5c0c0fac5e5a35fd34d16737d828cfe7b81ebe0..07689db1977b8f78ef24b2faae714a06719f69df 100644 (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