Added ability to see attached stickers from admin log.

This commit is contained in:
23rd 2020-10-30 12:38:50 +03:00
parent 665e322fce
commit 8d424f6eaf

View File

@ -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