diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index b450b3f43e..27b54f79de 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "history/history_inner_widget.h" +#include "chat_helpers/stickers_emoji_pack.h" #include "core/file_utilities.h" #include "core/click_handler_types.h" #include "history/history_item_helpers.h" @@ -32,6 +33,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/effects/message_sending_animation_controller.h" #include "ui/effects/reaction_fly_animation.h" #include "ui/text/text_options.h" +#include "ui/text/text_isolated_emoji.h" #include "ui/boxes/report_box.h" #include "ui/layers/generic_box.h" #include "ui/controls/delete_message_context_action.h" @@ -2249,6 +2251,20 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { } }; +#ifdef _DEBUG // Sometimes we need to save emoji to files. + if (const auto item = _dragStateItem) { + const auto emojiStickers = &session->emojiStickersPack(); + if (const auto view = item->media() ? nullptr : item->mainView()) { + if (const auto isolated = view->isolatedEmoji()) { + if (const auto sticker = emojiStickers->stickerForEmoji( + isolated)) { + addDocumentActions(sticker.document, item); + } + } + } + } +#endif + const auto asGroup = !Element::Moused() || (Element::Moused() != Element::Hovered()) || (Element::Moused()->pointState(