mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 22:46:10 +00:00
Add sending paid stories replies.
This commit is contained in:
@@ -266,6 +266,27 @@ bool PreparedList::hasSpoilerMenu(bool compress) const {
|
||||
return allAreVideo || (allAreMedia && compress);
|
||||
}
|
||||
|
||||
std::shared_ptr<PreparedBundle> PrepareFilesBundle(
|
||||
std::vector<PreparedGroup> groups,
|
||||
SendFilesWay way,
|
||||
TextWithTags caption,
|
||||
bool ctrlShiftEnter) {
|
||||
auto totalCount = 0;
|
||||
for (const auto &group : groups) {
|
||||
totalCount += group.list.files.size();
|
||||
}
|
||||
const auto sendComment = !caption.text.isEmpty()
|
||||
&& (groups.size() != 1 || !groups.front().sentWithCaption());
|
||||
return std::make_shared<PreparedBundle>(PreparedBundle{
|
||||
.groups = std::move(groups),
|
||||
.way = way,
|
||||
.caption = std::move(caption),
|
||||
.totalCount = totalCount + (sendComment ? 1 : 0),
|
||||
.sendComment = sendComment,
|
||||
.ctrlShiftEnter = ctrlShiftEnter,
|
||||
});
|
||||
}
|
||||
|
||||
int MaxAlbumItems() {
|
||||
return kMaxAlbumCount;
|
||||
}
|
||||
|
@@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#pragma once
|
||||
|
||||
#include "editor/photo_editor_common.h"
|
||||
#include "ui/chat/attach/attach_send_files_way.h"
|
||||
#include "ui/rect_part.h"
|
||||
|
||||
#include <QtCore/QSemaphore>
|
||||
@@ -153,6 +154,20 @@ struct PreparedGroup {
|
||||
SendFilesWay way,
|
||||
bool slowmode);
|
||||
|
||||
struct PreparedBundle {
|
||||
std::vector<PreparedGroup> groups;
|
||||
SendFilesWay way;
|
||||
TextWithTags caption;
|
||||
int totalCount = 0;
|
||||
bool sendComment = false;
|
||||
bool ctrlShiftEnter = false;
|
||||
};
|
||||
[[nodiscard]] std::shared_ptr<PreparedBundle> PrepareFilesBundle(
|
||||
std::vector<PreparedGroup> groups,
|
||||
SendFilesWay way,
|
||||
TextWithTags caption,
|
||||
bool ctrlShiftEnter);
|
||||
|
||||
[[nodiscard]] int MaxAlbumItems();
|
||||
[[nodiscard]] bool ValidateThumbDimensions(int width, int height);
|
||||
|
||||
|
Reference in New Issue
Block a user