-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TF-3157 Remove unnecessary background service worker
- Loading branch information
1 parent
7d59982
commit b76e8bb
Showing
20 changed files
with
151 additions
and
447 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
lib/features/push_notification/data/datasource/web_socket_datasource.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
import 'package:jmap_dart_client/jmap/account_id.dart'; | ||
import 'package:jmap_dart_client/jmap/core/session/session.dart'; | ||
import 'package:web_socket_channel/web_socket_channel.dart'; | ||
|
||
abstract class WebSocketDatasource { | ||
Stream<dynamic> getWebSocketChannel(Session session, AccountId accountId); | ||
Future<WebSocketChannel> getWebSocketChannel( | ||
Session session, | ||
AccountId accountId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 0 additions & 31 deletions
31
lib/features/push_notification/data/model/web_socket_echo.dart
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
lib/features/push_notification/data/model/web_socket_echo_request.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import 'package:jmap_dart_client/jmap/core/capability/capability_identifier.dart'; | ||
import 'package:tmail_ui_user/features/push_notification/data/model/web_socket_request.dart'; | ||
|
||
class WebSocketEchoRequest extends WebSocketRequest { | ||
static const String type = 'Request'; | ||
static const String id = 'R1'; | ||
static final CapabilityIdentifier usingCapability = CapabilityIdentifier.jmapCore; | ||
static const String method = 'Core/echo'; | ||
|
||
@override | ||
Map<String, dynamic> toJson() { | ||
return { | ||
'@type': type, | ||
'id': id, | ||
'using': [usingCapability.value.toString()], | ||
'methodCalls': [[method, {}, 'c0']], | ||
}; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
lib/features/push_notification/data/model/web_socket_push_enable_request.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import 'package:fcm/model/type_name.dart'; | ||
|
||
class WebSocketPushEnableRequest { | ||
static const String type = 'WebSocketPushEnable'; | ||
|
||
static Map<String, dynamic> toJson({ | ||
required List<TypeName> dataTypes, | ||
}) { | ||
return { | ||
'@type': type, | ||
'dataTypes': dataTypes.map((typeName) => typeName.value).toList(), | ||
}; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
lib/features/push_notification/data/model/web_socket_request.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
abstract class WebSocketRequest { | ||
const WebSocketRequest(); | ||
|
||
Map<String, dynamic> toJson(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
lib/features/push_notification/domain/repository/web_socket_repository.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
import 'package:jmap_dart_client/jmap/account_id.dart'; | ||
import 'package:jmap_dart_client/jmap/core/session/session.dart'; | ||
import 'package:web_socket_channel/web_socket_channel.dart'; | ||
|
||
abstract class WebSocketRepository { | ||
Stream getWebSocketChannel(Session session, AccountId accountId); | ||
Future<WebSocketChannel> getWebSocketChannel( | ||
Session session, | ||
AccountId accountId); | ||
} |
10 changes: 5 additions & 5 deletions
10
lib/features/push_notification/domain/state/web_socket_push_state.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.