Slightly improved box to edit caption of grouped file.

This commit is contained in:
23rd
2025-05-22 17:25:32 +03:00
parent 5ac373d4aa
commit adc1ee71a9
3 changed files with 27 additions and 8 deletions
@@ -404,12 +404,15 @@ void SendingAlbum::removeItem(not_null<HistoryItem*> item) {
Assert(i != end(items));
items.erase(i);
if (moveCaption) {
const auto caption = item->originalText();
auto caption = item->originalText();
const auto firstId = items.front().msgId;
if (const auto first = item->history()->owner().message(firstId)) {
// We don't need to finishEdition() here, because the whole
// album will be rebuilt after one item was removed from it.
first->setText(caption);
auto firstCaption = first->originalText();
first->setText(firstCaption.text.isEmpty()
? std::move(caption)
: firstCaption.append('\n').append(std::move(caption)));
refreshMediaCaption(first);
}
}