Skip to content

Commit

Permalink
emoji [nfc]: Make realmEmoji internal to EmojiStoreImpl
Browse files Browse the repository at this point in the history
It's a bit of a trap for the unwary (... like me last month, in
ecd2cb5, causing #1113), because it includes deactivated realm emoji
as well as active ones.
  • Loading branch information
gnprice authored and chrisbobbe committed Dec 9, 2024
1 parent d2f3bad commit 29fa03d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
7 changes: 2 additions & 5 deletions lib/model/emoji.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ final class EmojiCandidate {

/// The portion of [PerAccountStore] describing what emoji exist.
mixin EmojiStore {
/// The realm's custom emoji (for [ReactionType.realmEmoji],
/// indexed by [Reaction.emojiCode].
Map<String, RealmEmojiItem> get realmEmoji;

EmojiDisplay emojiDisplayFor({
required ReactionType emojiType,
required String emojiCode,
Expand Down Expand Up @@ -135,7 +131,8 @@ class EmojiStoreImpl with EmojiStore {
/// The same as [PerAccountStore.realmUrl].
final Uri realmUrl;

@override
/// The realm's custom emoji (for [ReactionType.realmEmoji],
/// indexed by [Reaction.emojiCode].
Map<String, RealmEmojiItem> realmEmoji;

/// The realm-relative URL of the unique "Zulip extra emoji", :zulip:.
Expand Down
3 changes: 0 additions & 3 deletions lib/model/store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,6 @@ class PerAccountStore extends ChangeNotifier with EmojiStore, ChannelStore, Mess
////////////////////////////////
// The realm's repertoire of available emoji.

@override
Map<String, RealmEmojiItem> get realmEmoji => _emoji.realmEmoji;

@override
EmojiDisplay emojiDisplayFor({
required ReactionType emojiType,
Expand Down
1 change: 0 additions & 1 deletion test/model/store_checks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ extension PerAccountStoreChecks on Subject<PerAccountStore> {
Subject<String> get zulipVersion => has((x) => x.zulipVersion, 'zulipVersion');
Subject<int> get maxFileUploadSizeMib => has((x) => x.maxFileUploadSizeMib, 'maxFileUploadSizeMib');
Subject<Map<String, RealmDefaultExternalAccount>> get realmDefaultExternalAccounts => has((x) => x.realmDefaultExternalAccounts, 'realmDefaultExternalAccounts');
Subject<Map<String, RealmEmojiItem>> get realmEmoji => has((x) => x.realmEmoji, 'realmEmoji');
Subject<List<CustomProfileField>> get customProfileFields => has((x) => x.customProfileFields, 'customProfileFields');
Subject<int> get accountId => has((x) => x.accountId, 'accountId');
Subject<Account> get account => has((x) => x.account, 'account');
Expand Down

0 comments on commit 29fa03d

Please sign in to comment.