mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Changed behavior to send text as caption to first file in files album.
This commit is contained in:
@@ -3815,10 +3815,22 @@ void ApiWrap::sendFiles(
|
||||
std::shared_ptr<SendingAlbum> album,
|
||||
const SendAction &action) {
|
||||
const auto haveCaption = !caption.text.isEmpty();
|
||||
if (haveCaption
|
||||
&& !list.canAddCaption(
|
||||
const auto captionAttached = !haveCaption
|
||||
? false
|
||||
: (list.files.size() == 1)
|
||||
? list.canAddCaption(
|
||||
album != nullptr,
|
||||
type == SendMediaType::Photo)) {
|
||||
type == SendMediaType::Photo)
|
||||
: Ui::CaptionWillBeAttached(
|
||||
list,
|
||||
[&] {
|
||||
auto way = Ui::SendFilesWay();
|
||||
way.setGroupFiles(album != nullptr);
|
||||
way.setSendImagesAsPhotos(type == SendMediaType::Photo);
|
||||
return way;
|
||||
}(),
|
||||
false);
|
||||
if (haveCaption && !captionAttached) {
|
||||
auto message = MessageToSend(action);
|
||||
message.textWithTags = base::take(caption);
|
||||
message.action.clearDraft = false;
|
||||
|
||||
Reference in New Issue
Block a user