diff --git a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp index 2157e91682..a5b72ca7ba 100644 --- a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp @@ -1134,9 +1134,7 @@ void EmojiListWidget::fillRecentMenu( not_null menu, int section, int index) { - if (section != int(Section::Recent)) { - return; - } + const auto recent = (section == int(Section::Recent)); const auto addAction = Ui::Menu::CreateAddActionCallback(menu); const auto over = OverEmoji{ section, index }; const auto emoji = lookupOverEmoji(&over); @@ -1157,18 +1155,21 @@ void EmojiListWidget::fillRecentMenu( TextUtilities::SetClipboardText(data); }, &st::menuIconCopy); } - if (setId && _features.openStickerSets) { + if (recent && setId && _features.openStickerSets) { addAction( tr::lng_emoji_view_pack(tr::now), crl::guard(this, [=] { displaySet(setId); }), &st::menuIconShowAll); } - } else if (emoji) { + } else if (recent && emoji) { addAction(tr::lng_emoji_copy(tr::now), [=] { const auto text = emoji->text(); TextUtilities::SetClipboardText({ text, { text } }); }, &st::menuIconCopy); } + if (!recent) { + return; + } auto id = RecentEmojiId{ emoji }; if (custom) { id.data = RecentEmojiDocument{ @@ -1194,7 +1195,7 @@ void EmojiListWidget::fillRecentMenu( .confirmed = crl::guard(this, sure), .confirmText = tr::lng_emoji_reset_recent_button(tr::now), .labelStyle = &st().boxLabel, - })); + })); }; addAction({ .text = tr::lng_emoji_reset_recent(tr::now),