Skip to content

Commit 83e7d17

Browse files
committed
Merge remote-tracking branch 'pr/1530'
2 parents 888b043 + 3669b15 commit 83e7d17

23 files changed

+192
-41
lines changed

assets/icons/ZulipIcons.ttf

804 Bytes
Binary file not shown.

assets/icons/eye.svg

Lines changed: 3 additions & 0 deletions
Loading

assets/icons/eye_off.svg

Lines changed: 3 additions & 0 deletions
Loading

assets/icons/person.svg

Lines changed: 10 additions & 0 deletions
Loading
File renamed without changes.

lib/api/model/events.dart

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ sealed class Event {
6262
}
6363
// case 'muted_topics': … // TODO(#422) we ignore this feature on older servers
6464
case 'user_topic': return UserTopicEvent.fromJson(json);
65+
case 'muted_users': return MutedUsersEvent.fromJson(json);
6566
case 'message': return MessageEvent.fromJson(json);
6667
case 'update_message': return UpdateMessageEvent.fromJson(json);
6768
case 'delete_message': return DeleteMessageEvent.fromJson(json);
@@ -733,6 +734,24 @@ class UserTopicEvent extends Event {
733734
Map<String, dynamic> toJson() => _$UserTopicEventToJson(this);
734735
}
735736

737+
/// A Zulip event of type `muted_users`: https://zulip.com/api/get-events#muted_users
738+
@JsonSerializable(fieldRename: FieldRename.snake)
739+
class MutedUsersEvent extends Event {
740+
@override
741+
@JsonKey(includeToJson: true)
742+
String get type => 'muted_users';
743+
744+
final List<MutedUserItem> mutedUsers;
745+
746+
MutedUsersEvent({required super.id, required this.mutedUsers});
747+
748+
factory MutedUsersEvent.fromJson(Map<String, dynamic> json) =>
749+
_$MutedUsersEventFromJson(json);
750+
751+
@override
752+
Map<String, dynamic> toJson() => _$MutedUsersEventToJson(this);
753+
}
754+
736755
/// A Zulip event of type `message`: https://zulip.com/api/get-events#message
737756
@JsonSerializable(fieldRename: FieldRename.snake)
738757
class MessageEvent extends Event {

lib/api/model/events.g.dart

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

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

113+
/// An item in the [InitialSnapshot.mutedUsers] or [MutedUsersEvent].
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+
// Mobile doesn't use the timestamp; ignore.
122+
// final int timestamp;
123+
124+
const MutedUserItem({required this.id});
125+
126+
factory MutedUserItem.fromJson(Map<String, dynamic> json) =>
127+
_$MutedUserItemFromJson(json);
128+
129+
Map<String, dynamic> toJson() => _$MutedUserItemToJson(this);
130+
}
131+
113132
/// An item in [InitialSnapshot.realmEmoji] or [RealmEmojiUpdateEvent].
114133
///
115134
/// For docs, search for "realm_emoji:"

0 commit comments

Comments
 (0)