diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index b282a3270..2500f5715 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -3952,6 +3952,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_context_read_show" = "show when"; "lng_context_edit_shortcut" = "Edit Shortcut"; "lng_context_delete_shortcut" = "Delete Quick Reply"; +"lng_context_gift_send" = "Send Another Gift"; "lng_add_tag_about" = "Tag this message with an emoji for quick search."; "lng_subscribe_tag_about" = "Organize your Saved Messages with tags. {link}"; diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index 8a3c5e2d6..066e19453 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -55,6 +55,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "boxes/about_sponsored_box.h" #include "boxes/delete_messages_box.h" #include "boxes/report_messages_box.h" +#include "boxes/star_gift_box.h" // ShowStarGiftBox #include "boxes/sticker_set_box.h" #include "boxes/translate_box.h" #include "chat_helpers/message_field.h" @@ -2770,6 +2771,29 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { _menu->addAction(tr::lng_profile_copy_phone(tr::now), [=] { QGuiApplication::clipboard()->setText(phone); }, &st::menuIconCopy); + } else if (const auto gift = media->gift()) { + const auto peer = item->history()->peer; + const auto user = peer->asUser(); + if (!user + || (!user->isInaccessible() + && !user->isNotificationsUser())) { + const auto controller = _controller; + const auto starGiftUpgrade = gift->upgrade + && (gift->type == Data::GiftType::StarGift); + const auto isGift = gift->slug.isEmpty() + || !gift->channel; + const auto out = item->out(); + const auto outgoingGift = isGift + && (starGiftUpgrade ? !out : out); + if (outgoingGift) { + _menu->addAction( + tr::lng_context_gift_send(tr::now), + [=] { + Ui::ShowStarGiftBox(controller, peer); + }, + &st::menuIconGiftPremium); + } + } } } if (!item->isService() && view && actionText.isEmpty()) {