Fixed ability to attach file while editing message in sections.

This commit is contained in:
23rd 2021-01-31 05:55:55 +03:00 committed by John Preston
parent 4695ccfdb8
commit 4ad0837661

View file

@ -767,7 +767,14 @@ rpl::producer<MessageToEdit> ComposeControls::editRequests() const {
}
rpl::producer<> ComposeControls::attachRequests() const {
return _attachToggle->clicks() | rpl::to_empty;
return _attachToggle->clicks(
) | rpl::to_empty | rpl::filter([=] {
if (isEditingMessage()) {
Ui::show(Box<InformBox>(tr::lng_edit_caption_attach(tr::now)));
return false;
}
return true;
});
}
void ComposeControls::setMimeDataHook(MimeDataHook hook) {