mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-13 23:13:32 +00:00
Enable upload caption edits in forum topics
Task: 2026/07/24/edit-uploading-captions-in-forum-topics
This commit is contained in:
@@ -951,6 +951,16 @@ bool AddDeleteMessageAction(
|
||||
}
|
||||
});
|
||||
if (item->isUploading()) {
|
||||
if (item->media() && item->media()->allowsEditCaption()) {
|
||||
menu->addAction(
|
||||
tr::lng_context_upload_edit_caption(tr::now),
|
||||
crl::guard(controller, [=] {
|
||||
if (const auto item = owner->message(itemId)) {
|
||||
list->showEditCaptionUploadLayer(item);
|
||||
}
|
||||
}),
|
||||
&st::menuIconEdit);
|
||||
}
|
||||
menu->addAction(
|
||||
tr::lng_context_cancel_upload(tr::now),
|
||||
callback,
|
||||
|
||||
@@ -72,10 +72,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/screen_reader_mode.h"
|
||||
#include "ui/ui_utility.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "boxes/peers/edit_participant_box.h"
|
||||
#include "boxes/delete_messages_box.h"
|
||||
#include "boxes/moderate_messages_box.h"
|
||||
#include "boxes/premium_preview_box.h"
|
||||
#include "boxes/peers/edit_participant_box.h"
|
||||
#include "boxes/send_gif_with_caption_box.h"
|
||||
#include "core/crash_reports.h"
|
||||
#include "data/components/sponsored_messages.h"
|
||||
#include "data/data_session.h"
|
||||
@@ -1680,6 +1681,14 @@ void ListWidget::selectItemAsGroup(not_null<HistoryItem*> item) {
|
||||
}
|
||||
}
|
||||
|
||||
void ListWidget::showEditCaptionUploadLayer(not_null<HistoryItem*> item) {
|
||||
if (const auto view = viewForItem(item)) {
|
||||
if (item->isUploading()) {
|
||||
controller()->show(Box(Ui::EditCaptionBox, view));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ListWidget::clearSelected() {
|
||||
if (_selected.empty()) {
|
||||
return;
|
||||
|
||||
@@ -353,6 +353,7 @@ public:
|
||||
void cancelSelection();
|
||||
void selectItem(not_null<HistoryItem*> item);
|
||||
void selectItemAsGroup(not_null<HistoryItem*> item);
|
||||
void showEditCaptionUploadLayer(not_null<HistoryItem*> item);
|
||||
|
||||
void touchScrollUpdated(const QPoint &screenPos);
|
||||
[[nodiscard]] rpl::producer<bool> touchMaybeSelectingValue() const;
|
||||
|
||||
Reference in New Issue
Block a user