Skip to content

Commit

Permalink
store: Add realmEmoji; update on its event
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbobbe committed Nov 20, 2023
1 parent bd1c71b commit 01ebaf6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/model/store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class PerAccountStore extends ChangeNotifier {
}) : zulipVersion = initialSnapshot.zulipVersion,
maxFileUploadSizeMib = initialSnapshot.maxFileUploadSizeMib,
realmDefaultExternalAccounts = initialSnapshot.realmDefaultExternalAccounts,
realmEmoji = initialSnapshot.realmEmoji,
customProfileFields = _sortCustomProfileFields(initialSnapshot.customProfileFields),
userSettings = initialSnapshot.userSettings,
unreads = Unreads(initial: initialSnapshot.unreadMsgs, selfUserId: account.userId),
Expand All @@ -181,6 +182,7 @@ class PerAccountStore extends ChangeNotifier {
final String zulipVersion; // TODO get from account; update there on initial snapshot
final int maxFileUploadSizeMib; // No event for this.
final Map<String, RealmDefaultExternalAccount> realmDefaultExternalAccounts;
Map<String, RealmEmojiItem> realmEmoji;
List<CustomProfileField> customProfileFields;

// Data attached to the self-account on the realm.
Expand Down Expand Up @@ -228,6 +230,10 @@ class PerAccountStore extends ChangeNotifier {
void handleEvent(Event event) {
if (event is HeartbeatEvent) {
assert(debugLog("server event: heartbeat"));
} else if (event is RealmEmojiUpdateEvent) {
assert(debugLog("server event: realm_emoji/update"));
realmEmoji = event.realmEmoji;
notifyListeners();
} else if (event is AlertWordsEvent) {
assert(debugLog("server event: alert_words"));
// We don't yet store this data, so there's nothing to update.
Expand Down

0 comments on commit 01ebaf6

Please sign in to comment.