File tree Expand file tree Collapse file tree 2 files changed +27
-17
lines changed Expand file tree Collapse file tree 2 files changed +27
-17
lines changed Original file line number Diff line number Diff line change @@ -441,7 +441,7 @@ class PerAccountStore extends PerAccountStoreBase with
441
441
RealmStore , ProxyRealmStore ,
442
442
EmojiStore , ProxyEmojiStore ,
443
443
SavedSnippetStore ,
444
- UserStore ,
444
+ UserStore , ProxyUserStore ,
445
445
ChannelStore ,
446
446
MessageStore {
447
447
/// Construct a store for the user's data, starting from the given snapshot.
@@ -595,23 +595,9 @@ class PerAccountStore extends PerAccountStoreBase with
595
595
//|//////////////////////////////
596
596
// Users and data about them.
597
597
598
+ @protected
598
599
@override
599
- User ? getUser (int userId) => _users.getUser (userId);
600
-
601
- @override
602
- Iterable <User > get allUsers => _users.allUsers;
603
-
604
- @override
605
- bool isUserMuted (int userId, {MutedUsersEvent ? event}) =>
606
- _users.isUserMuted (userId, event: event);
607
-
608
- @override
609
- MutedUsersVisibilityEffect mightChangeShouldMuteDmConversation (MutedUsersEvent event) =>
610
- _users.mightChangeShouldMuteDmConversation (event);
611
-
612
- @override
613
- UserStatus getUserStatus (int userId) => _users.getUserStatus (userId);
614
-
600
+ UserStore get userStore => _users;
615
601
final UserStoreImpl _users;
616
602
617
603
final TypingStatus typingStatus;
Original file line number Diff line number Diff line change
1
+ import 'package:flutter/foundation.dart' ;
2
+
1
3
import '../api/model/events.dart' ;
2
4
import '../api/model/initial_snapshot.dart' ;
3
5
import '../api/model/model.dart' ;
@@ -179,6 +181,28 @@ enum MutedUsersVisibilityEffect {
179
181
mixed;
180
182
}
181
183
184
+ mixin ProxyUserStore on UserStore {
185
+ @protected
186
+ UserStore get userStore;
187
+
188
+ @override
189
+ User ? getUser (int userId) => userStore.getUser (userId);
190
+
191
+ @override
192
+ Iterable <User > get allUsers => userStore.allUsers;
193
+
194
+ @override
195
+ bool isUserMuted (int userId, {MutedUsersEvent ? event}) =>
196
+ userStore.isUserMuted (userId, event: event);
197
+
198
+ @override
199
+ MutedUsersVisibilityEffect mightChangeShouldMuteDmConversation (MutedUsersEvent event) =>
200
+ userStore.mightChangeShouldMuteDmConversation (event);
201
+
202
+ @override
203
+ UserStatus getUserStatus (int userId) => userStore.getUserStatus (userId);
204
+ }
205
+
182
206
/// The implementation of [UserStore] that does the work.
183
207
///
184
208
/// Generally the only code that should need this class is [PerAccountStore]
You can’t perform that action at this time.
0 commit comments