Skip to content

Commit

Permalink
refactor: Also use authenticated media if unstable features claim sup…
Browse files Browse the repository at this point in the history
…port
  • Loading branch information
krille-chan committed Aug 20, 2024
1 parent 99564df commit b104788
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 b104788

Please sign in to comment.