diff options
author | Badlop <badlop@process-one.net> | 2016-12-02 16:18:22 +0100 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2016-12-02 16:18:35 +0100 |
commit | 847376924e0ca5d2cf16aa9c827184ef199d3d6d (patch) | |
tree | ab0ae6cbdcb6f046bc49f0c3c4e89846b4cd7fe7 /src/mod_muc_room.erl | |
parent | When unsubscribes, check if room should get closed (#1396) (diff) |
Add password support in muc_subscribe (#1306)
Diffstat (limited to 'src/mod_muc_room.erl')
-rw-r--r-- | src/mod_muc_room.erl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index c5c0c0fa..07689db1 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 |