From 4e8f5541af5ed06c1e6c8e836e7f10e96bfcce96 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 25 Dec 2017 17:16:44 +0300 Subject: [PATCH] Fix caption editing in grouped media. --- Telegram/SourceFiles/boxes/edit_caption_box.cpp | 1 + Telegram/SourceFiles/history/history_media_grouped.cpp | 4 ++++ Telegram/SourceFiles/history/history_media_grouped.h | 1 + 3 files changed, 6 insertions(+) diff --git a/Telegram/SourceFiles/boxes/edit_caption_box.cpp b/Telegram/SourceFiles/boxes/edit_caption_box.cpp index b64f7796c..db0204621 100644 --- a/Telegram/SourceFiles/boxes/edit_caption_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_caption_box.cpp @@ -67,6 +67,7 @@ EditCaptionBox::EditCaptionBox( if (const auto photo = media->getPhoto()) { dimensions = QSize(photo->full->width(), photo->full->height()); image = photo->full; + _photo = true; } else if (const auto doc = media->getDocument()) { dimensions = doc->dimensions; image = doc->thumb; diff --git a/Telegram/SourceFiles/history/history_media_grouped.cpp b/Telegram/SourceFiles/history/history_media_grouped.cpp index 942de592c..c4085bc76 100644 --- a/Telegram/SourceFiles/history/history_media_grouped.cpp +++ b/Telegram/SourceFiles/history/history_media_grouped.cpp @@ -449,6 +449,10 @@ bool HistoryGroupedMedia::needsBubble() const { return _needBubble; } +bool HistoryGroupedMedia::canEditCaption() const { + return main()->canEditCaption(); +} + bool HistoryGroupedMedia::computeNeedBubble() const { if (!_caption.isEmpty()) { return true; diff --git a/Telegram/SourceFiles/history/history_media_grouped.h b/Telegram/SourceFiles/history/history_media_grouped.h index fd4a6c065..f7d0cc853 100644 --- a/Telegram/SourceFiles/history/history_media_grouped.h +++ b/Telegram/SourceFiles/history/history_media_grouped.h @@ -108,6 +108,7 @@ public: bool customInfoLayout() const override { return _caption.isEmpty(); } + bool canEditCaption() const override; bool allowsFastShare() const override { return true; }