Skip to content

Commit b474d67

Browse files
committed
Add ability to have separate mechanisms for sasl and sasl2
1 parent 27316c7 commit b474d67

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/xmpp_stream_in.erl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,10 @@ get_sasl_mechanisms(#{stream_encrypted := Encrypted,
14231423
Mechs1 = if Encrypted -> [<<"EXTERNAL">> | Mechs];
14241424
true -> Mechs
14251425
end,
1426-
Mechs2 = try callback(sasl_mechanisms, Mechs1, State)
1426+
Mechs2 = try callback(sasl_mechanisms, Mechs1, State) of
1427+
{Sasl1, _} when Type == sasl -> Sasl1;
1428+
{_, Sasl2} when Type == sasl2 -> Sasl2;
1429+
Common -> Common
14271430
catch _:{?MODULE, undef} -> Mechs1
14281431
end,
14291432
if Type == sasl2 ->

0 commit comments

Comments
 (0)