Skip to content

Commit 8f67079

Browse files
chrisbobbegnprice
authored andcommitted
store: Add realmEmoji; update on its event
1 parent 401f38d commit 8f67079

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/model/store.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ class PerAccountStore extends ChangeNotifier {
155155
}) : zulipVersion = initialSnapshot.zulipVersion,
156156
maxFileUploadSizeMib = initialSnapshot.maxFileUploadSizeMib,
157157
realmDefaultExternalAccounts = initialSnapshot.realmDefaultExternalAccounts,
158+
realmEmoji = initialSnapshot.realmEmoji,
158159
customProfileFields = _sortCustomProfileFields(initialSnapshot.customProfileFields),
159160
userSettings = initialSnapshot.userSettings,
160161
unreads = Unreads(initial: initialSnapshot.unreadMsgs, selfUserId: account.userId),
@@ -181,6 +182,7 @@ class PerAccountStore extends ChangeNotifier {
181182
final String zulipVersion; // TODO get from account; update there on initial snapshot
182183
final int maxFileUploadSizeMib; // No event for this.
183184
final Map<String, RealmDefaultExternalAccount> realmDefaultExternalAccounts;
185+
Map<String, RealmEmojiItem> realmEmoji;
184186
List<CustomProfileField> customProfileFields;
185187

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

0 commit comments

Comments
 (0)