@@ -5,14 +5,16 @@ import 'package:flutter/foundation.dart';
5
5
import '../api/model/events.dart' ;
6
6
import '../api/model/initial_snapshot.dart' ;
7
7
import '../api/model/model.dart' ;
8
+ import 'store.dart' ;
9
+ import 'user.dart' ;
8
10
9
11
/// The portion of [PerAccountStore] for channels, topics, and stuff about them.
10
12
///
11
13
/// This type is useful for expressing the needs of other parts of the
12
14
/// implementation of [PerAccountStore] , to avoid circularity.
13
15
///
14
16
/// The data structures described here are implemented at [ChannelStoreImpl] .
15
- mixin ChannelStore {
17
+ mixin ChannelStore on UserStore {
16
18
/// All known channels/streams, indexed by [ZulipStream.streamId] .
17
19
///
18
20
/// The same [ZulipStream] objects also appear in [streamsByName] .
@@ -165,8 +167,11 @@ enum UserTopicVisibilityEffect {
165
167
/// Generally the only code that should need this class is [PerAccountStore]
166
168
/// itself. Other code accesses this functionality through [PerAccountStore] ,
167
169
/// or through the mixin [ChannelStore] which describes its interface.
168
- class ChannelStoreImpl with ChannelStore {
169
- factory ChannelStoreImpl ({required InitialSnapshot initialSnapshot}) {
170
+ class ChannelStoreImpl extends HasUserStore with ChannelStore {
171
+ factory ChannelStoreImpl ({
172
+ required UserStore users,
173
+ required InitialSnapshot initialSnapshot,
174
+ }) {
170
175
final subscriptions = Map .fromEntries (initialSnapshot.subscriptions.map (
171
176
(subscription) => MapEntry (subscription.streamId, subscription)));
172
177
@@ -186,6 +191,7 @@ class ChannelStoreImpl with ChannelStore {
186
191
}
187
192
188
193
return ChannelStoreImpl ._(
194
+ users: users,
189
195
streams: streams,
190
196
streamsByName: streams.map ((_, stream) => MapEntry (stream.name, stream)),
191
197
subscriptions: subscriptions,
@@ -194,6 +200,7 @@ class ChannelStoreImpl with ChannelStore {
194
200
}
195
201
196
202
ChannelStoreImpl ._({
203
+ required super .users,
197
204
required this .streams,
198
205
required this .streamsByName,
199
206
required this .subscriptions,
0 commit comments