Skip to content

Commit 2984999

Browse files
sm-sayedichrisbobbe
authored andcommitted
api: Add InitialSnapshot.mutedUsers
1 parent 834834b commit 2984999

File tree

5 files changed

+32
-0
lines changed

5 files changed

+32
-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: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,22 @@ class CustomProfileFieldExternalAccountData {
110110
Map<String, dynamic> toJson() => _$CustomProfileFieldExternalAccountDataToJson(this);
111111
}
112112

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

lib/api/model/model.g.dart

Lines changed: 6 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
@@ -1019,6 +1019,7 @@ InitialSnapshot initialSnapshot({
10191019
int? serverTypingStartedExpiryPeriodMilliseconds,
10201020
int? serverTypingStoppedWaitPeriodMilliseconds,
10211021
int? serverTypingStartedWaitPeriodMilliseconds,
1022+
List<MutedUserItem>? mutedUsers,
10221023
Map<String, RealmEmojiItem>? realmEmoji,
10231024
List<RecentDmConversation>? recentPrivateConversations,
10241025
List<SavedSnippet>? savedSnippets,
@@ -1055,6 +1056,7 @@ InitialSnapshot initialSnapshot({
10551056
serverTypingStoppedWaitPeriodMilliseconds ?? 5000,
10561057
serverTypingStartedWaitPeriodMilliseconds:
10571058
serverTypingStartedWaitPeriodMilliseconds ?? 10000,
1059+
mutedUsers: mutedUsers ?? [],
10581060
realmEmoji: realmEmoji ?? {},
10591061
recentPrivateConversations: recentPrivateConversations ?? [],
10601062
savedSnippets: savedSnippets ?? [],

0 commit comments

Comments
 (0)