Skip to content

Commit 8a6ade8

Browse files
committed
Add Video.start_timestamp.
1 parent 7882783 commit 8a6ade8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

telegram-bot-api/Client.cpp

+9-5
Original file line numberDiff line numberDiff line change
@@ -1499,8 +1499,8 @@ class Client::JsonChatPhoto final : public td::Jsonable {
14991499

15001500
class Client::JsonVideo final : public td::Jsonable {
15011501
public:
1502-
JsonVideo(const td_api::video *video, const td_api::photo *cover, const Client *client)
1503-
: video_(video), cover_(cover), client_(client) {
1502+
JsonVideo(const td_api::video *video, const td_api::photo *cover, int32 start_timestamp, const Client *client)
1503+
: video_(video), cover_(cover), start_timestamp_(start_timestamp), client_(client) {
15041504
}
15051505
void store(td::JsonValueScope *scope) const {
15061506
auto object = scope->enter_object();
@@ -1516,13 +1516,17 @@ class Client::JsonVideo final : public td::Jsonable {
15161516
if (cover_ != nullptr) {
15171517
object("cover", JsonPhoto(cover_, client_));
15181518
}
1519+
if (start_timestamp_ > 0) {
1520+
object("start_timestamp", start_timestamp_);
1521+
}
15191522
client_->json_store_thumbnail(object, video_->thumbnail_.get());
15201523
client_->json_store_file(object, video_->video_.get());
15211524
}
15221525

15231526
private:
15241527
const td_api::video *video_;
15251528
const td_api::photo *cover_;
1529+
int32 start_timestamp_;
15261530
const Client *client_;
15271531
};
15281532

@@ -1591,7 +1595,7 @@ class Client::JsonPaidMedia final : public td::Jsonable {
15911595
case td_api::paidMediaVideo::ID: {
15921596
auto media = static_cast<const td_api::paidMediaVideo *>(paid_media_);
15931597
object("type", "video");
1594-
object("video", JsonVideo(media->video_.get(), media->cover_.get(), client_));
1598+
object("video", JsonVideo(media->video_.get(), media->cover_.get(), media->start_timestamp_, client_));
15951599
break;
15961600
}
15971601
case td_api::paidMediaUnsupported::ID:
@@ -2810,7 +2814,7 @@ class Client::JsonExternalReplyInfo final : public td::Jsonable {
28102814
}
28112815
case td_api::messageVideo::ID: {
28122816
auto content = static_cast<const td_api::messageVideo *>(reply_->content_.get());
2813-
object("video", JsonVideo(content->video_.get(), content->cover_.get(), client_));
2817+
object("video", JsonVideo(content->video_.get(), content->cover_.get(), content->start_timestamp_, client_));
28142818
add_media_spoiler(object, content->has_spoiler_);
28152819
break;
28162820
}
@@ -3068,7 +3072,7 @@ void Client::JsonMessage::store(td::JsonValueScope *scope) const {
30683072
}
30693073
case td_api::messageVideo::ID: {
30703074
auto content = static_cast<const td_api::messageVideo *>(message_->content.get());
3071-
object("video", JsonVideo(content->video_.get(), content->cover_.get(), client_));
3075+
object("video", JsonVideo(content->video_.get(), content->cover_.get(), content->start_timestamp_, client_));
30723076
add_caption(object, content->caption_, content->show_caption_above_media_);
30733077
add_media_spoiler(object, content->has_spoiler_);
30743078
break;

0 commit comments

Comments
 (0)