Skip to content

Commit 451ec5a

Browse files
committed
api: Add InitialSnapshot.mutedUsers
1 parent 2a6c8af commit 451ec5a

File tree

5 files changed

+37
-0
lines changed

5 files changed

+37
-0
lines changed

lib/api/model/initial_snapshot.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ class InitialSnapshot {
4444

4545
// final List<…> mutedTopics; // TODO(#422) we ignore this feature on older servers
4646

47+
final List<MutedUserItem> mutedUsers;
48+
4749
final Map<String, RealmEmojiItem> realmEmoji;
4850

4951
final List<RecentDmConversation> recentPrivateConversations;
@@ -132,6 +134,7 @@ class InitialSnapshot {
132134
required this.serverTypingStartedExpiryPeriodMilliseconds,
133135
required this.serverTypingStoppedWaitPeriodMilliseconds,
134136
required this.serverTypingStartedWaitPeriodMilliseconds,
137+
required this.mutedUsers,
135138
required this.realmEmoji,
136139
required this.recentPrivateConversations,
137140
required this.savedSnippets,

lib/api/model/initial_snapshot.g.dart

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/api/model/model.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,24 @@ class CustomProfileFieldExternalAccountData {
110110
Map<String, dynamic> toJson() => _$CustomProfileFieldExternalAccountDataToJson(this);
111111
}
112112

113+
114+
/// An item in the [InitialSnapshot.mutedUsers].
115+
///
116+
/// For docs, search for "muted_users:"
117+
/// in <https://zulip.com/api/register-queue>.
118+
@JsonSerializable(fieldRename: FieldRename.snake)
119+
class MutedUserItem {
120+
final int id;
121+
final int timestamp;
122+
123+
const MutedUserItem({required this.id, required this.timestamp});
124+
125+
factory MutedUserItem.fromJson(Map<String, dynamic> json) =>
126+
_$MutedUserItemFromJson(json);
127+
128+
Map<String, dynamic> toJson() => _$MutedUserItemToJson(this);
129+
}
130+
113131
/// An item in [InitialSnapshot.realmEmoji] or [RealmEmojiUpdateEvent].
114132
///
115133
/// For docs, search for "realm_emoji:"

lib/api/model/model.g.dart

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/example_data.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,7 @@ InitialSnapshot initialSnapshot({
979979
int? serverTypingStartedExpiryPeriodMilliseconds,
980980
int? serverTypingStoppedWaitPeriodMilliseconds,
981981
int? serverTypingStartedWaitPeriodMilliseconds,
982+
List<MutedUserItem>? mutedUsers,
982983
Map<String, RealmEmojiItem>? realmEmoji,
983984
List<RecentDmConversation>? recentPrivateConversations,
984985
List<SavedSnippet>? savedSnippets,
@@ -1015,6 +1016,7 @@ InitialSnapshot initialSnapshot({
10151016
serverTypingStoppedWaitPeriodMilliseconds ?? 5000,
10161017
serverTypingStartedWaitPeriodMilliseconds:
10171018
serverTypingStartedWaitPeriodMilliseconds ?? 10000,
1019+
mutedUsers: mutedUsers ?? [],
10181020
realmEmoji: realmEmoji ?? {},
10191021
recentPrivateConversations: recentPrivateConversations ?? [],
10201022
savedSnippets: savedSnippets ?? [],

0 commit comments

Comments
 (0)