@@ -20,6 +20,7 @@ import '../log.dart';
20
20
import '../notifications/receive.dart' ;
21
21
import 'autocomplete.dart' ;
22
22
import 'database.dart' ;
23
+ import 'emoji.dart' ;
23
24
import 'message.dart' ;
24
25
import 'message_list.dart' ;
25
26
import 'recent_dm_conversations.dart' ;
@@ -202,7 +203,7 @@ abstract class GlobalStore extends ChangeNotifier {
202
203
/// This class does not attempt to poll an event queue
203
204
/// to keep the data up to date. For that behavior, see
204
205
/// [UpdateMachine] .
205
- class PerAccountStore extends ChangeNotifier with ChannelStore , MessageStore {
206
+ class PerAccountStore extends ChangeNotifier with EmojiStore , ChannelStore , MessageStore {
206
207
/// Construct a store for the user's data, starting from the given snapshot.
207
208
///
208
209
/// The global store must already have been updated with
@@ -234,9 +235,9 @@ class PerAccountStore extends ChangeNotifier with ChannelStore, MessageStore {
234
235
realmUrl: account.realmUrl,
235
236
maxFileUploadSizeMib: initialSnapshot.maxFileUploadSizeMib,
236
237
realmDefaultExternalAccounts: initialSnapshot.realmDefaultExternalAccounts,
237
- realmEmoji: initialSnapshot.realmEmoji,
238
238
customProfileFields: _sortCustomProfileFields (initialSnapshot.customProfileFields),
239
239
emailAddressVisibility: initialSnapshot.emailAddressVisibility,
240
+ emoji: EmojiStoreImpl (realmEmoji: initialSnapshot.realmEmoji),
240
241
accountId: accountId,
241
242
selfUserId: account.userId,
242
243
userSettings: initialSnapshot.userSettings,
@@ -268,9 +269,9 @@ class PerAccountStore extends ChangeNotifier with ChannelStore, MessageStore {
268
269
required this .realmUrl,
269
270
required this .maxFileUploadSizeMib,
270
271
required this .realmDefaultExternalAccounts,
271
- required this .realmEmoji,
272
272
required this .customProfileFields,
273
273
required this .emailAddressVisibility,
274
+ required EmojiStoreImpl emoji,
274
275
required this .accountId,
275
276
required this .selfUserId,
276
277
required this .userSettings,
@@ -285,6 +286,7 @@ class PerAccountStore extends ChangeNotifier with ChannelStore, MessageStore {
285
286
assert (realmUrl == globalStore.getAccount (accountId)! .realmUrl),
286
287
assert (realmUrl == connection.realmUrl),
287
288
_globalStore = globalStore,
289
+ _emoji = emoji,
288
290
_channels = channels,
289
291
_messages = messages;
290
292
@@ -320,11 +322,18 @@ class PerAccountStore extends ChangeNotifier with ChannelStore, MessageStore {
320
322
String get zulipVersion => account.zulipVersion;
321
323
final int maxFileUploadSizeMib; // No event for this.
322
324
final Map <String , RealmDefaultExternalAccount > realmDefaultExternalAccounts;
323
- Map <String , RealmEmojiItem > realmEmoji;
324
325
List <CustomProfileField > customProfileFields;
325
326
/// For docs, please see [InitialSnapshot.emailAddressVisibility] .
326
327
final EmailAddressVisibility ? emailAddressVisibility; // TODO(#668): update this realm setting
327
328
329
+ ////////////////////////////////
330
+ // The realm's repertoire of available emoji.
331
+
332
+ @override
333
+ Map <String , RealmEmojiItem > get realmEmoji => _emoji.realmEmoji;
334
+
335
+ EmojiStoreImpl _emoji;
336
+
328
337
////////////////////////////////
329
338
// Data attached to the self-account on the realm.
330
339
@@ -423,7 +432,7 @@ class PerAccountStore extends ChangeNotifier with ChannelStore, MessageStore {
423
432
424
433
case RealmEmojiUpdateEvent ():
425
434
assert (debugLog ("server event: realm_emoji/update" ));
426
- realmEmoji = event.realmEmoji ;
435
+ _emoji. handleRealmEmojiUpdateEvent (event) ;
427
436
notifyListeners ();
428
437
429
438
case AlertWordsEvent ():
0 commit comments