mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 15:13:57 +02:00
Fixed ability to send file to photo/video album from EditCaptionBox.
This commit is contained in:
parent
f74a75da75
commit
c6cdf0a4c4
1 changed files with 13 additions and 0 deletions
|
@ -410,9 +410,14 @@ void EditCaptionBox::setupPhotoEditorEventHandler() {
|
||||||
controller->session().settings().incrementPhotoEditorHintShown();
|
controller->session().settings().incrementPhotoEditorHintShown();
|
||||||
controller->session().saveSettings();
|
controller->session().saveSettings();
|
||||||
};
|
};
|
||||||
|
const auto clearError = [=] {
|
||||||
|
_error = QString();
|
||||||
|
update();
|
||||||
|
};
|
||||||
const auto previewWidth = st::sendMediaPreviewSize;
|
const auto previewWidth = st::sendMediaPreviewSize;
|
||||||
if (!_preparedList.files.empty()) {
|
if (!_preparedList.files.empty()) {
|
||||||
increment();
|
increment();
|
||||||
|
clearError();
|
||||||
Editor::OpenWithPreparedFile(
|
Editor::OpenWithPreparedFile(
|
||||||
this,
|
this,
|
||||||
controller,
|
controller,
|
||||||
|
@ -425,6 +430,7 @@ void EditCaptionBox::setupPhotoEditorEventHandler() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
increment();
|
increment();
|
||||||
|
clearError();
|
||||||
auto callback = [=](const Editor::PhotoModifications &mods) {
|
auto callback = [=](const Editor::PhotoModifications &mods) {
|
||||||
if (!mods || !_photoMedia) {
|
if (!mods || !_photoMedia) {
|
||||||
return;
|
return;
|
||||||
|
@ -687,6 +693,13 @@ void EditCaptionBox::save() {
|
||||||
options.scheduled = item->isScheduled() ? item->date() : 0;
|
options.scheduled = item->isScheduled() ? item->date() : 0;
|
||||||
|
|
||||||
if (!_preparedList.files.empty()) {
|
if (!_preparedList.files.empty()) {
|
||||||
|
if ((_albumType != Ui::AlbumType::None)
|
||||||
|
&& !_preparedList.files.front().canBeInAlbumType(
|
||||||
|
_albumType)) {
|
||||||
|
_error = tr::lng_edit_media_album_error(tr::now);
|
||||||
|
update();
|
||||||
|
return;
|
||||||
|
}
|
||||||
auto action = Api::SendAction(item->history(), options);
|
auto action = Api::SendAction(item->history(), options);
|
||||||
action.replaceMediaOf = item->fullId().msg;
|
action.replaceMediaOf = item->fullId().msg;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue