Skip to content

Commit

Permalink
Merge pull request #1905 from famedly/krille/use-auth-media-if-unstab…
Browse files Browse the repository at this point in the history
…le-features

refactor: Also use authenticated media if unstable features claim support
  • Loading branch information
krille-chan authored Aug 21, 2024
2 parents a979c2e + 2dce08b commit 4e0f057
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/src/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1164,11 +1164,11 @@ class Client extends MatrixApi {
GetVersionsResponse? _versionsCache;

Future<bool> authenticatedMediaSupported() async {
_versionsCache ??= await getVersions();
return _versionsCache?.versions.any(
final versionsResponse = _versionsCache ??= await getVersions();
return versionsResponse.versions.any(
(v) => isVersionGreaterThanOrEqualTo(v, 'v1.11'),
) ??
false;
) ||
versionsResponse.unstableFeatures?['org.matrix.msc3916.stable'] == true;
}

final _serverConfigCache = AsyncCache<ServerConfig>(const Duration(hours: 1));
Expand Down

0 comments on commit 4e0f057

Please sign in to comment.