-
Notifications
You must be signed in to change notification settings - Fork 341
Track data for channel folders! #1894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
63b5b83
36e7c96
3da70bc
3ff64be
84604e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,8 @@ class InitialSnapshot { | |
|
||
final UnreadMessagesSnapshot unreadMsgs; | ||
|
||
final List<ChannelFolder>? channelFolders; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO(server-11), right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: commit-message prefixes, similar to #1869 (comment) ; the current revision has 63b5b83 initial_snapshot: Add channelFolders and I think the first three should all say "api:". |
||
|
||
final List<ZulipStream> streams; | ||
|
||
// In register-queue, the name of this field is the singular "user_status", | ||
|
@@ -166,6 +168,7 @@ class InitialSnapshot { | |
required this.recentPrivateConversations, | ||
required this.savedSnippets, | ||
required this.subscriptions, | ||
required this.channelFolders, | ||
required this.unreadMsgs, | ||
required this.streams, | ||
required this.userStatuses, | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -650,6 +650,8 @@ class ZulipStream { | |
int? messageRetentionDays; | ||
@JsonKey(name: 'stream_post_policy') | ||
ChannelPostPolicy? channelPostPolicy; // TODO(server-10) remove | ||
// TODO(server-11) delete TODO but keep optional, for channels not in folders | ||
int? folderId; | ||
Comment on lines
+653
to
+654
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is equivalent to not having a TODO, right? That seems simpler 🙂 |
||
// final bool isAnnouncementOnly; // deprecated for `channelPostPolicy`; ignore | ||
Comment on lines
652
to
655
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: this stanza is all various kinds of permission settings; let's pull this field out separately, earlier. (We already have this class's fields in a different order from the docs in order to be more logical, in particular grouping |
||
|
||
GroupSettingValue? canAddSubscribersGroup; // TODO(server-10) | ||
|
@@ -674,6 +676,7 @@ class ZulipStream { | |
required this.historyPublicToSubscribers, | ||
required this.messageRetentionDays, | ||
required this.channelPostPolicy, | ||
required this.folderId, | ||
required this.canAddSubscribersGroup, | ||
required this.canDeleteAnyMessageGroup, | ||
required this.canDeleteOwnMessageGroup, | ||
|
@@ -697,6 +700,7 @@ class ZulipStream { | |
historyPublicToSubscribers: subscription.historyPublicToSubscribers, | ||
messageRetentionDays: subscription.messageRetentionDays, | ||
channelPostPolicy: subscription.channelPostPolicy, | ||
folderId: subscription.folderId, | ||
canAddSubscribersGroup: subscription.canAddSubscribersGroup, | ||
canDeleteAnyMessageGroup: subscription.canDeleteAnyMessageGroup, | ||
canDeleteOwnMessageGroup: subscription.canDeleteOwnMessageGroup, | ||
|
@@ -733,6 +737,7 @@ enum ChannelPropertyName { | |
messageRetentionDays, | ||
@JsonValue('stream_post_policy') | ||
channelPostPolicy, | ||
folderId, | ||
canAddSubscribersGroup, | ||
canDeleteAnyMessageGroup, | ||
canDeleteOwnMessageGroup, | ||
|
@@ -818,6 +823,7 @@ class Subscription extends ZulipStream { | |
required super.historyPublicToSubscribers, | ||
required super.messageRetentionDays, | ||
required super.channelPostPolicy, | ||
required super.folderId, | ||
required super.canAddSubscribersGroup, | ||
required super.canDeleteAnyMessageGroup, | ||
required super.canDeleteOwnMessageGroup, | ||
|
@@ -841,6 +847,38 @@ class Subscription extends ZulipStream { | |
Map<String, dynamic> toJson() => _$SubscriptionToJson(this); | ||
} | ||
|
||
/// As in `channel_folders` in the initial snapshot. | ||
/// | ||
/// For docs, search for "channel_folders:" | ||
/// in <https://zulip.com/api/register-queue>. | ||
@JsonSerializable(fieldRename: FieldRename.snake) | ||
class ChannelFolder { | ||
final int id; | ||
String name; | ||
int? order; // TODO(server-11); added in a later FL than the rest | ||
final int? dateCreated; | ||
final int? creatorId; | ||
String description; | ||
String renderedDescription; | ||
bool isArchived; | ||
|
||
ChannelFolder({ | ||
required this.id, | ||
required this.name, | ||
required this.order, | ||
required this.dateCreated, | ||
required this.creatorId, | ||
required this.description, | ||
required this.renderedDescription, | ||
required this.isArchived, | ||
}); | ||
|
||
factory ChannelFolder.fromJson(Map<String, dynamic> json) => | ||
_$ChannelFolderFromJson(json); | ||
|
||
Map<String, dynamic> toJson() => _$ChannelFolderToJson(this); | ||
} | ||
|
||
@JsonEnum(fieldRename: FieldRename.snake, valueField: "apiValue") | ||
enum UserTopicVisibilityPolicy { | ||
none(apiValue: 0), | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: docs have these in opposite order