Skip to content

Commit c4bd4ad

Browse files
committed
api: Mark otherUserId as required, relying on server 5+, FL 119+
See "Feature level 119" from Zulip API changelog: https://zulip.com/api/changelog See also: https://chat.zulip.org/#narrow/stream/412-api-documentation/topic/register.3A.20When.20was.20.60unread_msgs.2Epms.5B.5D.2Eother_user_id.60.20added.3F Signed-off-by: Zixuan James Li <[email protected]>
1 parent d8f6ae3 commit c4bd4ad

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

lib/api/model/initial_snapshot.dart

-6
Original file line numberDiff line numberDiff line change
@@ -269,15 +269,9 @@ class UnreadMessagesSnapshot {
269269
/// An item in [UnreadMessagesSnapshot.dms].
270270
@JsonSerializable(fieldRename: FieldRename.snake)
271271
class UnreadDmSnapshot {
272-
@JsonKey(readValue: _readOtherUserId)
273272
final int otherUserId;
274273
final List<int> unreadMessageIds;
275274

276-
// TODO(server-5): Simplify away.
277-
static dynamic _readOtherUserId(Map<dynamic, dynamic> json, String key) {
278-
return json[key] ?? json['sender_id'];
279-
}
280-
281275
UnreadDmSnapshot({
282276
required this.otherUserId,
283277
required this.unreadMessageIds,

lib/api/model/initial_snapshot.g.dart

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)