1
1
import 'package:dynamite_runtime/http_client.dart' ;
2
2
import 'package:universal_io/io.dart' ;
3
3
4
- /// Different app types to register for
5
- enum AppType {
6
- /// Will only receive Talk notifications
7
- talk ('Mozilla/5.0 (Android) Nextcloud-Talk' ),
8
-
9
- /// Will receive all notifications except Talk notifications if another Talk
10
- /// app is already registered for the user
11
- nextcloud ('Mozilla/5.0 (Android) Nextcloud-android' ),
12
-
13
- /// Default. Same problem with notifications as the [nextcloud] type
14
- unknown (null );
15
-
16
- // ignore: public_member_api_docs
17
- const AppType (this .userAgent);
18
-
19
- // ignore: public_member_api_docs
20
- final String ? userAgent;
21
- }
22
-
23
4
// ignore: public_member_api_docs
24
5
class NextcloudClient extends DynamiteClient {
25
6
// ignore: public_member_api_docs
@@ -29,15 +10,13 @@ class NextcloudClient extends DynamiteClient {
29
10
String ? password,
30
11
String ? appPassword,
31
12
String ? language,
32
- AppType appType = AppType .unknown,
33
- String ? userAgentOverride,
13
+ String ? userAgent,
34
14
super .httpClient,
35
15
super .cookieJar,
36
16
}) : super (
37
17
baseHeaders: {
38
18
if (language != null ) HttpHeaders .acceptLanguageHeader: language,
39
- if ((userAgentOverride ?? appType.userAgent) != null )
40
- HttpHeaders .userAgentHeader: userAgentOverride ?? appType.userAgent! ,
19
+ if (userAgent != null ) HttpHeaders .userAgentHeader: userAgent,
41
20
},
42
21
authentications: [
43
22
if (appPassword != null )
0 commit comments