From 8d424f6eaf86f1d5a2c7a42ffe1f6dbf3e1397c4 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 30 Oct 2020 12:38:50 +0300 Subject: [PATCH] Added ability to see attached stickers from admin log. --- .../admin_log/history_admin_log_inner.cpp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp index 2d0b7f92d..b3908f152 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp @@ -26,6 +26,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "mainwidget.h" #include "core/application.h" #include "apiwrap.h" +#include "api/api_attached_stickers.h" #include "layout.h" #include "window/window_session_controller.h" #include "main/main_session.h" @@ -1072,6 +1073,16 @@ void InnerWidget::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { _menu->addAction(tr::lng_context_copy_image(tr::now), [=] { copyContextImage(photo); }); + if (photo->hasAttachedStickers()) { + const auto controller = _controller; + auto callback = [=] { + auto &attached = session().api().attachedStickers(); + attached.requestAttachedStickerSets(controller, photo); + }; + _menu->addAction( + tr::lng_context_attached_stickers(tr::now), + std::move(callback)); + } } else { auto document = lnkDocument->document(); if (document->loading()) { @@ -1104,6 +1115,16 @@ void InnerWidget::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { _menu->addAction(lnkIsVideo ? tr::lng_context_save_video(tr::now) : (lnkIsVoice ? tr::lng_context_save_audio(tr::now) : (lnkIsAudio ? tr::lng_context_save_audio_file(tr::now) : tr::lng_context_save_file(tr::now))), App::LambdaDelayed(st::defaultDropdownMenu.menu.ripple.hideDuration, this, [this, document] { saveDocumentToFile(document); })); + if (document->hasAttachedStickers()) { + const auto controller = _controller; + auto callback = [=, doc = document] { + auto &attached = session().api().attachedStickers(); + attached.requestAttachedStickerSets(controller, doc); + }; + _menu->addAction( + tr::lng_context_attached_stickers(tr::now), + std::move(callback)); + } } } } else if (lnkPeer) { // suggest to block