Skip to content

Commit df88682

Browse files
committed
channel [nfc]: Rename references of ChannelStoreImpl to match it's name
Fixes parts of #631
1 parent 95ff1e0 commit df88682

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

lib/model/store.dart

+14-14
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class PerAccountStore extends ChangeNotifier with ChannelStore, MessageStore {
226226
connection ??= globalStore.apiConnectionFromAccount(account);
227227
assert(connection.zulipFeatureLevel == account.zulipFeatureLevel);
228228

229-
final streams = ChannelStoreImpl(initialSnapshot: initialSnapshot);
229+
final channels = ChannelStoreImpl(initialSnapshot: initialSnapshot);
230230
return PerAccountStore._(
231231
globalStore: globalStore,
232232
connection: connection,
@@ -247,12 +247,12 @@ class PerAccountStore extends ChangeNotifier with ChannelStore, MessageStore {
247247
selfUserId: account.userId,
248248
typingStartedExpiryPeriod: Duration(milliseconds: initialSnapshot.serverTypingStartedExpiryPeriodMilliseconds),
249249
),
250-
streams: streams,
250+
channels: channels,
251251
messages: MessageStoreImpl(),
252252
unreads: Unreads(
253253
initial: initialSnapshot.unreadMsgs,
254254
selfUserId: account.userId,
255-
channelStore: streams,
255+
channelStore: channels,
256256
),
257257
recentDmConversationsView: RecentDmConversationsView(
258258
initial: initialSnapshot.recentPrivateConversations, selfUserId: account.userId),
@@ -272,15 +272,15 @@ class PerAccountStore extends ChangeNotifier with ChannelStore, MessageStore {
272272
required this.userSettings,
273273
required this.users,
274274
required this.typingStatus,
275-
required ChannelStoreImpl streams,
275+
required ChannelStoreImpl channels,
276276
required MessageStoreImpl messages,
277277
required this.unreads,
278278
required this.recentDmConversationsView,
279279
}) : assert(selfUserId == globalStore.getAccount(accountId)!.userId),
280280
assert(realmUrl == globalStore.getAccount(accountId)!.realmUrl),
281281
assert(realmUrl == connection.realmUrl),
282282
_globalStore = globalStore,
283-
_streams = streams,
283+
_channels = channels,
284284
_messages = messages;
285285

286286
////////////////////////////////////////////////////////////////
@@ -331,19 +331,19 @@ class PerAccountStore extends ChangeNotifier with ChannelStore, MessageStore {
331331
// Streams, topics, and stuff about them.
332332

333333
@override
334-
Map<int, ZulipStream> get streams => _streams.streams;
334+
Map<int, ZulipStream> get streams => _channels.streams;
335335
@override
336-
Map<String, ZulipStream> get streamsByName => _streams.streamsByName;
336+
Map<String, ZulipStream> get streamsByName => _channels.streamsByName;
337337
@override
338-
Map<int, Subscription> get subscriptions => _streams.subscriptions;
338+
Map<int, Subscription> get subscriptions => _channels.subscriptions;
339339
@override
340340
UserTopicVisibilityPolicy topicVisibilityPolicy(int streamId, String topic) =>
341-
_streams.topicVisibilityPolicy(streamId, topic);
341+
_channels.topicVisibilityPolicy(streamId, topic);
342342

343-
final ChannelStoreImpl _streams;
343+
final ChannelStoreImpl _channels;
344344

345345
@visibleForTesting
346-
ChannelStoreImpl get debugStreamStore => _streams;
346+
ChannelStoreImpl get debugChannelStore => _channels;
347347

348348
////////////////////////////////
349349
// Messages, and summaries of messages.
@@ -474,17 +474,17 @@ class PerAccountStore extends ChangeNotifier with ChannelStore, MessageStore {
474474

475475
case StreamEvent():
476476
assert(debugLog("server event: stream/${event.op}"));
477-
_streams.handleStreamEvent(event);
477+
_channels.handleStreamEvent(event);
478478
notifyListeners();
479479

480480
case SubscriptionEvent():
481481
assert(debugLog("server event: subscription/${event.op}"));
482-
_streams.handleSubscriptionEvent(event);
482+
_channels.handleSubscriptionEvent(event);
483483
notifyListeners();
484484

485485
case UserTopicEvent():
486486
assert(debugLog("server event: user_topic"));
487-
_streams.handleUserTopicEvent(event);
487+
_channels.handleUserTopicEvent(event);
488488
notifyListeners();
489489

490490
case MessageEvent():

test/model/channel_test.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ void main() {
193193
final expectedStore = eg.store(initialSnapshot: eg.initialSnapshot(
194194
userTopics: expected,
195195
));
196-
check(store.debugStreamStore.topicVisibility)
197-
.deepEquals(expectedStore.debugStreamStore.topicVisibility);
196+
check(store.debugChannelStore.topicVisibility)
197+
.deepEquals(expectedStore.debugChannelStore.topicVisibility);
198198
}
199199

200200
test('data structure', () {
@@ -206,7 +206,7 @@ void main() {
206206
eg.userTopicItem(stream2, 'topic 3', UserTopicVisibilityPolicy.unknown),
207207
eg.userTopicItem(stream2, 'topic 4', UserTopicVisibilityPolicy.followed),
208208
]));
209-
check(store.debugStreamStore.topicVisibility).deepEquals({
209+
check(store.debugChannelStore.topicVisibility).deepEquals({
210210
stream1.streamId: {
211211
'topic 1': UserTopicVisibilityPolicy.muted,
212212
'topic 2': UserTopicVisibilityPolicy.unmuted,

0 commit comments

Comments
 (0)