Skip to content

Commit

Permalink
api: Mark otherUserId as required, relying on server 5+, FL 119+
Browse files Browse the repository at this point in the history
  • Loading branch information
PIG208 committed Aug 23, 2024
1 parent e5df278 commit 4f7c773
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
6 changes: 0 additions & 6 deletions lib/api/model/initial_snapshot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,9 @@ class UnreadMessagesSnapshot {
/// An item in [UnreadMessagesSnapshot.dms].
@JsonSerializable(fieldRename: FieldRename.snake)
class UnreadDmSnapshot {
@JsonKey(readValue: _readOtherUserId)
final int otherUserId;
final List<int> unreadMessageIds;

// TODO(server-5): Simplify away.
static dynamic _readOtherUserId(Map<dynamic, dynamic> json, String key) {
return json[key] ?? json['sender_id'];
}

UnreadDmSnapshot({
required this.otherUserId,
required this.unreadMessageIds,
Expand Down
4 changes: 1 addition & 3 deletions lib/api/model/initial_snapshot.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4f7c773

Please sign in to comment.