From 9a0ea78e0f23289154f29eb721edf34931ec1c57 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 18 Feb 2024 20:11:57 +0400 Subject: [PATCH] Don't show duplicated emoji set. --- .../SourceFiles/chat_helpers/emoji_list_widget.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp index 224dafa08..42513a6ed 100644 --- a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp @@ -2114,6 +2114,16 @@ void EmojiListWidget::refreshCustom() { : setId; if (!lookupId) { return; + } else if (!megagroup + && !_custom.empty() + && _custom.front().id == Data::Stickers::MegagroupSetId + && _megagroupSet->mgInfo->emojiSet.id == setId) { + // Skip the set that is already added as a megagroup set. + return; + } else if (megagroup + && ranges::contains(_custom, lookupId, &CustomSet::id)) { + // Skip the set that is already added as a custom set. + return; } auto it = sets.find(lookupId); if (it == sets.cend()