Browse Source

refactor(nextcloud): Move app type to client

Signed-off-by: jld3103 <jld3103yt@gmail.com>
pull/869/head
jld3103 1 year ago
parent
commit
77ad07a7af
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 1
      packages/nextcloud/lib/nextcloud.dart
  2. 18
      packages/nextcloud/lib/src/app_type.dart
  3. 19
      packages/nextcloud/lib/src/client.dart

1
packages/nextcloud/lib/nextcloud.dart

@ -21,7 +21,6 @@ export 'src/api/updatenotification.openapi.dart';
export 'src/api/uppush.openapi.dart'; export 'src/api/uppush.openapi.dart';
export 'src/api/user_status.openapi.dart'; export 'src/api/user_status.openapi.dart';
export 'src/api/weather_status.openapi.dart'; export 'src/api/weather_status.openapi.dart';
export 'src/app_type.dart';
export 'src/client.dart'; export 'src/client.dart';
export 'src/helpers/core.dart'; export 'src/helpers/core.dart';
export 'src/helpers/news.dart'; export 'src/helpers/news.dart';

18
packages/nextcloud/lib/src/app_type.dart

@ -1,18 +0,0 @@
/// Different app types to register for
enum AppType {
/// Will only receive Talk notifications
talk('Mozilla/5.0 (Android) Nextcloud-Talk'),
/// Will receive all notifications except Talk notifications if another Talk
/// app is already registered for the user
nextcloud('Mozilla/5.0 (Android) Nextcloud-android'),
/// Default. Same problem with notifications as the [nextcloud] type
unknown(null);
// ignore: public_member_api_docs
const AppType(this.userAgent);
// ignore: public_member_api_docs
final String? userAgent;
}

19
packages/nextcloud/lib/src/client.dart

@ -1,5 +1,24 @@
import 'package:nextcloud/nextcloud.dart'; import 'package:nextcloud/nextcloud.dart';
/// Different app types to register for
enum AppType {
/// Will only receive Talk notifications
talk('Mozilla/5.0 (Android) Nextcloud-Talk'),
/// Will receive all notifications except Talk notifications if another Talk
/// app is already registered for the user
nextcloud('Mozilla/5.0 (Android) Nextcloud-android'),
/// Default. Same problem with notifications as the [nextcloud] type
unknown(null);
// ignore: public_member_api_docs
const AppType(this.userAgent);
// ignore: public_member_api_docs
final String? userAgent;
}
// ignore: public_member_api_docs // ignore: public_member_api_docs
class NextcloudClient extends DynamiteClient { class NextcloudClient extends DynamiteClient {
// ignore: public_member_api_docs // ignore: public_member_api_docs

Loading…
Cancel
Save