diff --git a/CHANGELOG.md b/CHANGELOG.md index 20b024c3..c718fa82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [0.9.10] - 7nd Jun 2022 +- feat: Allow overriding supportedVersions (Christian Pauly) + ## [0.9.9] - 2nd Jun 2022 - fix: Added deprecation mention for getUserByMXIDSync. diff --git a/lib/src/client.dart b/lib/src/client.dart index 94214e6c..278b34d5 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -355,8 +355,13 @@ class Client extends MatrixApi { /// login types. Throws an exception if the server is not compatible with the /// client and sets [homeserver] to [homeserverUrl] if it is. Supports the /// types `Uri` and `String`. - Future checkHomeserver(Uri homeserverUrl, - {bool checkWellKnown = true}) async { + Future checkHomeserver( + Uri homeserverUrl, { + bool checkWellKnown = true, + Set? overrideSupportedVersions, + }) async { + final supportedVersions = + overrideSupportedVersions ?? Client.supportedVersions; try { homeserver = homeserverUrl.stripTrailingSlash(); @@ -376,7 +381,9 @@ class Client extends MatrixApi { if (!versions.versions .any((version) => supportedVersions.contains(version))) { throw BadServerVersionsException( - versions.versions.toSet(), supportedVersions); + versions.versions.toSet(), + supportedVersions, + ); } final loginTypes = await getLoginFlows() ?? []; diff --git a/lib/src/event.dart b/lib/src/event.dart index 54061d0b..2c0146cb 100644 --- a/lib/src/event.dart +++ b/lib/src/event.dart @@ -657,7 +657,7 @@ class Event extends MatrixEvent { removeMarkdown: removeMarkdown); } - @Deprecated("Use getLocalizedBodyAsync") + @Deprecated('Use getLocalizedBodyAsync') String getLocalizedBody(MatrixLocalizations i18n, {bool withSenderNamePrefix = false, bool hideReply = false, diff --git a/lib/src/room.dart b/lib/src/room.dart index ebde0470..5831f72d 100644 --- a/lib/src/room.dart +++ b/lib/src/room.dart @@ -1417,7 +1417,7 @@ class Room { } @Deprecated( - "The method was renamed unsafeGetUserFromMemoryOrFallback. Please prefer requestParticipants.") + 'The method was renamed unsafeGetUserFromMemoryOrFallback. Please prefer requestParticipants.') User getUserByMXIDSync(String mxID) { return unsafeGetUserFromMemoryOrFallback(mxID); } diff --git a/pubspec.yaml b/pubspec.yaml index 2eab99a2..480388a2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: matrix description: Matrix Dart SDK -version: 0.9.9 +version: 0.9.10 homepage: https://famedly.com repository: https://gitlab.com/famedly/company/frontend/famedlysdk.git