Allow sending videos with covers.

This commit is contained in:
John Preston
2025-01-29 09:24:01 +04:00
parent 6a415cf232
commit e05bb75b8a
42 changed files with 571 additions and 104 deletions
@@ -196,6 +196,8 @@ struct FilePrepareResult {
std::vector<MTPInputDocument> attachedStickers;
std::shared_ptr<FilePrepareResult> videoCover;
void setFileData(const QByteArray &filedata);
void setThumbData(const QByteArray &thumbdata);
@@ -222,6 +224,7 @@ public:
const QString &filepath,
const QByteArray &content,
std::unique_ptr<Ui::PreparedFileInformation> information,
std::unique_ptr<FileLoadTask> videoCover,
SendMediaType type,
const FileLoadTo &to,
const TextWithTags &caption,
@@ -252,7 +255,8 @@ public:
}
void finish() override;
FilePrepareResult *peekResult() const;
[[nodiscard]] auto peekResult() const
-> const std::shared_ptr<FilePrepareResult> &;
private:
static bool CheckForSong(
@@ -281,6 +285,7 @@ private:
const std::shared_ptr<SendingAlbum> _album;
QString _filepath;
QByteArray _content;
std::unique_ptr<FileLoadTask> _videoCover;
std::unique_ptr<Ui::PreparedFileInformation> _information;
crl::time _duration = 0;
VoiceWaveform _waveform;