Merge branch 'krille/override-supported-versions' into 'main'

Krille/override supported versions

See merge request famedly/company/frontend/famedlysdk!1047
This commit is contained in:
Krille Fear 2022-06-07 07:19:59 +00:00
commit 40c048f9be
5 changed files with 16 additions and 6 deletions

View File

@ -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.

View File

@ -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<HomeserverSummary> checkHomeserver(Uri homeserverUrl,
{bool checkWellKnown = true}) async {
Future<HomeserverSummary> checkHomeserver(
Uri homeserverUrl, {
bool checkWellKnown = true,
Set<String>? 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() ?? [];

View File

@ -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,

View File

@ -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);
}

View File

@ -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