diff --git a/packages/nextcloud/lib/src/helpers/spreed.dart b/packages/nextcloud/lib/src/helpers/spreed.dart index 6d248983e66..1b00eb30136 100644 --- a/packages/nextcloud/lib/src/helpers/spreed.dart +++ b/packages/nextcloud/lib/src/helpers/spreed.dart @@ -1,3 +1,4 @@ +import 'package:nextcloud/nextcloud.dart'; import 'package:nextcloud/src/api/core.openapi.dart' as core; import 'package:nextcloud/src/api/spreed.openapi.dart' as spreed; import 'package:version/version.dart'; @@ -10,11 +11,11 @@ extension SpreedVersionSupported on spreed.Client { /// Checks whether the spreed app installed on the server is supported by this client. /// /// Also returns the supported version number. - Future<(bool, int)> isSupported(final core.OcsGetCapabilitiesResponseApplicationJson_Ocs_Data capabilities) async { + VersionSupported isSupported(final core.OcsGetCapabilitiesResponseApplicationJson_Ocs_Data capabilities) { final version = capabilities.capabilities.spreedPublicCapabilities?.spreedPublicCapabilities0?.spreed.version; return ( - version != null && Version.parse(version).major == supportedVersion, - supportedVersion, + isSupported: version != null && Version.parse(version).major == supportedVersion, + minimumVersion: supportedVersion, ); } } diff --git a/packages/nextcloud/test/spreed_test.dart b/packages/nextcloud/test/spreed_test.dart index b45e55f1ddd..7214c79a67f 100644 --- a/packages/nextcloud/test/spreed_test.dart +++ b/packages/nextcloud/test/spreed_test.dart @@ -40,8 +40,8 @@ void main() { expect(response.statusCode, 200); expect(() => response.headers, isA()); - final (supported, _) = await client1.spreed.isSupported(response.body.ocs.data); - expect(supported, isTrue); + final result = client1.spreed.isSupported(response.body.ocs.data); + expect(result.isSupported, isTrue); }); test('Participant permissions', () async {