2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

improved video, audio overview, fixed files overview

This commit is contained in:
John Preston
2015-12-23 15:19:32 +03:00
parent af9908f076
commit 41f5a87c80
8 changed files with 104 additions and 76 deletions

View File

@@ -941,10 +941,12 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
_menu->addAction(lang(lng_context_reply_msg), _widget, SLOT(onReplyToMessage()));
}
if (item && !isUponSelected && !_contextMenuLnk) {
if (HistorySticker *sticker = dynamic_cast<HistorySticker*>(msg ? msg->getMedia() : 0)) {
DocumentData *doc = sticker->document();
if (doc && doc->sticker() && doc->sticker()->set.type() != mtpc_inputStickerSetEmpty) {
_menu->addAction(lang(doc->sticker()->setInstalled() ? lng_context_pack_info : lng_context_pack_add), _widget, SLOT(onStickerPackInfo()));
if (HistoryMedia *media = (msg ? msg->getMedia() : 0)) {
if (media->type() == MediaTypeSticker) {
DocumentData *doc = media->getDocument();
if (doc && doc->sticker() && doc->sticker()->set.type() != mtpc_inputStickerSetEmpty) {
_menu->addAction(lang(doc->sticker()->setInstalled() ? lng_context_pack_info : lng_context_pack_add), _widget, SLOT(onStickerPackInfo()));
}
}
}
QString contextMenuText = item->selectedText(FullSelection);
@@ -6236,10 +6238,11 @@ void HistoryWidget::onReplyForwardPreviewCancel() {
}
void HistoryWidget::onStickerPackInfo() {
if (HistoryMessage *item = dynamic_cast<HistoryMessage*>(App::contextItem())) {
if (HistorySticker *sticker = dynamic_cast<HistorySticker*>(item->getMedia())) {
if (sticker->document() && sticker->document()->sticker() && sticker->document()->sticker()->set.type() != mtpc_inputStickerSetEmpty) {
App::main()->stickersBox(sticker->document()->sticker()->set);
if (HistoryMedia *media = (App::contextItem() ? App::contextItem()->getMedia() : 0)) {
if (media->type() == MediaTypeSticker) {
DocumentData *doc = media->getDocument();
if (doc && doc->sticker() && doc->sticker()->set.type() != mtpc_inputStickerSetEmpty) {
App::main()->stickersBox(doc->sticker()->set);
}
}
}