blob: a35c161f3204b554ffbbbdc9cd00f2f56d8b552c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2026
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/telegram/DialogId.h"
#include "td/telegram/files/FileId.h"
#include "td/telegram/Photo.h"
#include "td/telegram/telegram_api.h"
#include "td/utils/common.h"
#include "td/utils/Status.h"
namespace td {
class Td;
class MessageCover {
enum class Type : int32 { Empty, Photo, Video };
Type type_ = Type::Empty;
Photo photo_;
FileId video_file_id_;
public:
MessageCover() = default;
explicit MessageCover(const Photo &photo) : type_(Type::Photo), photo_(photo) {
}
explicit MessageCover(FileId video_file_id) : type_(Type::Video), video_file_id_(video_file_id) {
}
bool is_empty() const {
return type_ == Type::Empty;
}
FileId get_any_file_id() const;
telegram_api::object_ptr<telegram_api::InputMedia> get_cover_input_media(Td *td, bool force,
bool allow_external) const;
telegram_api::object_ptr<telegram_api::InputMedia> get_input_media(
Td *td, telegram_api::object_ptr<telegram_api::InputFile> &&input_file);
Status merge_with_media(Td *td, DialogId owner_dialog_id,
telegram_api::object_ptr<telegram_api::MessageMedia> &&media_ptr);
};
} // namespace td
|