-
Notifications
You must be signed in to change notification settings - Fork 349
api: Add ZulipStream.topicsPolicy #1956
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?
Conversation
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.
Thanks! Comments below.
Also, some commit-message nits:
api: Add ZulipStream.TopicsPolicy
Ingest String `topics_policy` field. The field can take be one of 4
possible values, inherit, allow_empty_topic, disable_empty_topic,
and empty_topic_only. Enum TopicsPolicy is created for these four
values.
Fixes: https://github.com/zulip/zulip-flutter/issues/1604
ZulipStream.TopicsPolicydoesn't refer to anything that exists; instead, sayZulipStream.topicsPolicy(referring to the field) orTopicsPolicy(referring to the enum).- The paragraph ("Ingest String…") just repeats what's already clear and expected in the diff; let's remove it, so there's less we need to read through.
- This work is a prerequisite for #1604 (making the data available to the app), but I'd like to keep #1604 open for the work of actually using the data in the compose-box UI code. So let's remove the "Fixes" line.
7cffea4 to
17fca1c
Compare
17fca1c to
02b5b4d
Compare
|
I see you've pushed changes; please comment here when this is ready for another review. |
02b5b4d to
22cdda8
Compare
|
Thanks for reviewing before! It's ready for another round. |
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.
Thanks! Just one nit below.
lib/api/model/model.dart
Outdated
| static TopicsPolicy fromRawString(String raw) => _byRawString[raw] ?? inherit; | ||
|
|
||
| static final _byRawString = _$TopicsPolicyEnumMap.map((key, value) => MapEntry(value, key)); |
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.
Let's call these fromApiValue and _byApiValue.
|
I've also removed the "Fixes:" line from the PR description, for the same reason I mentioned above in #1956 (review). |
22cdda8 to
6639351
Compare
Enum TopicsPolicy is created for these four values: inherit, allow_empty_topic, disable_empty_topic, and empty_topic_only.
6639351 to
afc7562
Compare
Ingest String
topics_policyfield. Will be used to hide the topic input in the general-chat-only channel.