refactor: Also use authenticated media if unstable features claim support

This commit is contained in:
Krille 2024-08-20 12:53:41 +02:00
parent a979c2e4fb
commit 2dce08bab1
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652
1 changed files with 4 additions and 4 deletions

View File

@ -1164,11 +1164,11 @@ class Client extends MatrixApi {
GetVersionsResponse? _versionsCache; GetVersionsResponse? _versionsCache;
Future<bool> authenticatedMediaSupported() async { Future<bool> authenticatedMediaSupported() async {
_versionsCache ??= await getVersions(); final versionsResponse = _versionsCache ??= await getVersions();
return _versionsCache?.versions.any( return versionsResponse.versions.any(
(v) => isVersionGreaterThanOrEqualTo(v, 'v1.11'), (v) => isVersionGreaterThanOrEqualTo(v, 'v1.11'),
) ?? ) ||
false; versionsResponse.unstableFeatures?['org.matrix.msc3916.stable'] == true;
} }
final _serverConfigCache = AsyncCache<ServerConfig>(const Duration(hours: 1)); final _serverConfigCache = AsyncCache<ServerConfig>(const Duration(hours: 1));