|
|
@ -17,12 +17,18 @@ extension CoreVersionSupported on CoreClient { |
|
|
|
/// Check if the core/Server version is supported by this client |
|
|
|
/// Check if the core/Server version is supported by this client |
|
|
|
/// |
|
|
|
/// |
|
|
|
/// Also returns the supported version number |
|
|
|
/// Also returns the supported version number |
|
|
|
Future<(bool, int)> isSupported(final CoreServerCapabilities_Ocs_Data capabilities) async => ( |
|
|
|
(bool, int) isSupported(final CoreServerCapabilities_Ocs_Data capabilities) => ( |
|
|
|
capabilities.version.major == coreSupportedVersion, |
|
|
|
capabilities.version.major == coreSupportedVersion, |
|
|
|
coreSupportedVersion, |
|
|
|
coreSupportedVersion, |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ignore: public_member_api_docs |
|
|
|
|
|
|
|
extension CoreStatusVersionSupported on CoreServerStatus { |
|
|
|
|
|
|
|
/// Check if the core/Server version is supported |
|
|
|
|
|
|
|
bool get isSupported => version.startsWith('$coreSupportedVersion.'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ignore: public_member_api_docs |
|
|
|
// ignore: public_member_api_docs |
|
|
|
extension NewsVersionSupported on NewsClient { |
|
|
|
extension NewsVersionSupported on NewsClient { |
|
|
|
/// Check if the news app version is supported by this client |
|
|
|
/// Check if the news app version is supported by this client |
|
|
@ -42,7 +48,7 @@ extension NotesVersionSupported on NotesClient { |
|
|
|
/// Check if the notes app version is supported by this client |
|
|
|
/// Check if the notes app version is supported by this client |
|
|
|
/// |
|
|
|
/// |
|
|
|
/// Also returns the supported API version number |
|
|
|
/// Also returns the supported API version number |
|
|
|
Future<(bool, int)> isSupported(final CoreServerCapabilities_Ocs_Data capabilities) async => ( |
|
|
|
(bool, int) isSupported(final CoreServerCapabilities_Ocs_Data capabilities) => ( |
|
|
|
capabilities.capabilities.notes?.apiVersion |
|
|
|
capabilities.capabilities.notes?.apiVersion |
|
|
|
?.map(Version.parse) |
|
|
|
?.map(Version.parse) |
|
|
|
.where((final version) => version.major == notesSupportedVersion) |
|
|
|
.where((final version) => version.major == notesSupportedVersion) |
|
|
|