chore: workaround for invalid getTurnServer responses from synapse

This commit is contained in:
Lukas Lihotzki 2021-09-27 13:25:12 +02:00
parent 57706bd02e
commit 5c3db7a602
1 changed files with 13 additions and 0 deletions

View File

@ -186,4 +186,17 @@ class MatrixApi extends Api {
);
return;
}
/// This API provides credentials for the client to use when initiating
/// calls.
@override
Future<TurnServerCredentials> getTurnServer() async {
final json = await request(RequestType.GET, '/client/r0/voip/turnServer');
// fix invalid responses from synapse
// https://github.com/matrix-org/synapse/pull/10922
json['ttl'] = json['ttl'].toInt();
return TurnServerCredentials.fromJson(json);
}
}