@@ -329,10 +329,15 @@ class AccountNotFoundException implements Exception {}
329
329
330
330
/// A bundle of items that are useful to [PerAccountStore] and its substores.
331
331
class CorePerAccountStore {
332
- CorePerAccountStore ({required this .connection, required this .queueId});
332
+ CorePerAccountStore ({
333
+ required this .connection,
334
+ required this .queueId,
335
+ required this .selfUserId,
336
+ });
333
337
334
338
final ApiConnection connection; // TODO(#135): update zulipFeatureLevel with events
335
339
final String queueId;
340
+ final int selfUserId;
336
341
}
337
342
338
343
/// A base class for [PerAccountStore] and its substores,
@@ -345,6 +350,7 @@ abstract class PerAccountStoreBase {
345
350
346
351
ApiConnection get connection => _core.connection;
347
352
String get queueId => _core.queueId;
353
+ int get selfUserId => _core.selfUserId;
348
354
}
349
355
350
356
/// Store for the user's data for a given Zulip account.
@@ -388,7 +394,8 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
388
394
}
389
395
390
396
final realmUrl = account.realmUrl;
391
- final core = CorePerAccountStore (connection: connection, queueId: queueId);
397
+ final core = CorePerAccountStore (
398
+ connection: connection, queueId: queueId, selfUserId: account.userId);
392
399
final channels = ChannelStoreImpl (initialSnapshot: initialSnapshot);
393
400
return PerAccountStore ._(
394
401
globalStore: globalStore,
@@ -414,21 +421,22 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
414
421
milliseconds: initialSnapshot.serverTypingStartedWaitPeriodMilliseconds),
415
422
),
416
423
users: UserStoreImpl (
417
- selfUserId : account.userId ,
424
+ core : core ,
418
425
initialSnapshot: initialSnapshot),
419
426
typingStatus: TypingStatus (
420
- selfUserId : account.userId ,
427
+ core : core ,
421
428
typingStartedExpiryPeriod: Duration (milliseconds: initialSnapshot.serverTypingStartedExpiryPeriodMilliseconds),
422
429
),
423
430
channels: channels,
424
431
messages: MessageStoreImpl (core: core),
425
432
unreads: Unreads (
433
+ core: core,
426
434
initial: initialSnapshot.unreadMsgs,
427
- selfUserId: account.userId,
428
435
channelStore: channels,
429
436
),
430
437
recentDmConversationsView: RecentDmConversationsView (
431
- initial: initialSnapshot.recentPrivateConversations, selfUserId: account.userId),
438
+ core: core,
439
+ initial: initialSnapshot.recentPrivateConversations),
432
440
recentSenders: RecentSenders (),
433
441
);
434
442
}
0 commit comments