Skip to content

Commit

Permalink
Merge pull request syphon-org#733 from syphon-org/fix/spec-private-re…
Browse files Browse the repository at this point in the history
…ad-receipts

fix: Private Read Receipts have hit a spec version!
  • Loading branch information
ereio authored Oct 2, 2022
2 parents 42af033 + 2e3e90d commit 3f41619
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/store/settings/actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -242,19 +242,23 @@ ThunkAction<AppState> incrementLanguage() {
};
}

///Supported since Spec v1.4
///https://spec.matrix.org/v1.4/client-server-api/#private-read-receipts
Future<bool> homeserverSupportsPrivateReadReceipts(
Store<AppState> store) async {
final version = await MatrixApi.checkVersion(
protocol: store.state.authStore.protocol,
homeserver: store.state.authStore.user.homeserver,
);

final supportedVersions = version['versions'];
final unstableFeatures = version['unstable_features'];

//TODO: update when this hits a spec version
return unstableFeatures != null &&
unstableFeatures.containsKey('org.matrix.msc2285.stable') &&
unstableFeatures['org.matrix.msc2285.stable'];
//TODO: deprecate unstableFeatures check
return (supportedVersions.contains('v1.4')) ||
unstableFeatures != null &&
unstableFeatures.containsKey('org.matrix.msc2285.stable') &&
unstableFeatures['org.matrix.msc2285.stable'];
}

@Deprecated('Due to be unsupported as of Synapse v1.67.0')
Expand Down

0 comments on commit 3f41619

Please sign in to comment.