Skip to content

Commit e174ee4

Browse files
committed
api: Remove sender_id fallback for UnreadMessagesSnapshot.otherUserId, 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 ecbbd6d commit e174ee4

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
@@ -270,15 +270,9 @@ class UnreadMessagesSnapshot {
270270
/// An item in [UnreadMessagesSnapshot.dms].
271271
@JsonSerializable(fieldRename: FieldRename.snake)
272272
class UnreadDmSnapshot {
273-
@JsonKey(readValue: _readOtherUserId)
274273
final int otherUserId;
275274
final List<int> unreadMessageIds;
276275

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