-
Notifications
You must be signed in to change notification settings - Fork 314
Mute muted users (Chris's revision, 2 of 2) #1561
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
c47024e
9e99dea
9e8c892
8878485
5d34d08
ccb5e13
f191080
becfbce
004c05d
acc3c39
6489bd5
9cd2972
7b5250d
c03987a
ff6bd53
f23302b
d1895b7
c447d4f
411df89
5438a65
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,10 +69,10 @@ mixin ChannelStore { | |
|
||
/// Whether the given event will change the result of [isTopicVisibleInStream] | ||
/// for its stream and topic, compared to the current state. | ||
VisibilityEffect willChangeIfTopicVisibleInStream(UserTopicEvent event) { | ||
UserTopicVisibilityEffect willChangeIfTopicVisibleInStream(UserTopicEvent event) { | ||
final streamId = event.streamId; | ||
final topic = event.topicName; | ||
return VisibilityEffect._fromBeforeAfter( | ||
return UserTopicVisibilityEffect._fromBeforeAfter( | ||
_isTopicVisibleInStream(topicVisibilityPolicy(streamId, topic)), | ||
_isTopicVisibleInStream(event.visibilityPolicy)); | ||
} | ||
|
@@ -106,10 +106,10 @@ mixin ChannelStore { | |
|
||
/// Whether the given event will change the result of [isTopicVisible] | ||
/// for its stream and topic, compared to the current state. | ||
VisibilityEffect willChangeIfTopicVisible(UserTopicEvent event) { | ||
UserTopicVisibilityEffect willChangeIfTopicVisible(UserTopicEvent event) { | ||
final streamId = event.streamId; | ||
final topic = event.topicName; | ||
return VisibilityEffect._fromBeforeAfter( | ||
return UserTopicVisibilityEffect._fromBeforeAfter( | ||
_isTopicVisible(streamId, topicVisibilityPolicy(streamId, topic)), | ||
_isTopicVisible(streamId, event.visibilityPolicy)); | ||
} | ||
|
@@ -137,7 +137,7 @@ mixin ChannelStore { | |
/// Whether and how a given [UserTopicEvent] will affect the results | ||
/// that [ChannelStore.isTopicVisible] or [ChannelStore.isTopicVisibleInStream] | ||
/// would give for some messages. | ||
enum VisibilityEffect { | ||
enum UserTopicVisibilityEffect { | ||
/// The event will have no effect on the visibility results. | ||
none, | ||
|
||
|
@@ -147,11 +147,11 @@ enum VisibilityEffect { | |
/// The event will change some visibility results from false to true. | ||
unmuted; | ||
|
||
factory VisibilityEffect._fromBeforeAfter(bool before, bool after) { | ||
factory UserTopicVisibilityEffect._fromBeforeAfter(bool before, bool after) { | ||
return switch ((before, after)) { | ||
(false, true) => VisibilityEffect.unmuted, | ||
(true, false) => VisibilityEffect.muted, | ||
_ => VisibilityEffect.none, | ||
(false, true) => UserTopicVisibilityEffect.unmuted, | ||
(true, false) => UserTopicVisibilityEffect.muted, | ||
_ => UserTopicVisibilityEffect.none, | ||
Comment on lines
-152
to
+154
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.
Yeah, agreed. Some of the verbosity (like in these lines) will at least get resolved by the upcoming Dart feature of "dot shorthands", expected later this year: I believe with that feature we'll be able to say just |
||
}; | ||
} | ||
} | ||
|
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:
The comment was already a bit separated from what it applied to, so perhaps should have been moved down there sooner; but this would widen the separation, so let's fix it.
(Can stay in the same commit, no need to make a separate prep commit.)