Skip to content

Commit

Permalink
Fixed build.
Browse files Browse the repository at this point in the history
  • Loading branch information
23rd committed Oct 28, 2023
1 parent b619436 commit 9acd3a9
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Telegram/SourceFiles/api/api_as_copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,24 @@ MsgId ReplyToIdFromDraft(not_null<PeerData*> peer) {
const auto history = peer->owner().history(peer);
const auto replyTo = [&]() -> int64 {
if (const auto localDraft = history->localDraft(0)) {
return localDraft->msgId.bare;
return localDraft->reply.messageId.msg.bare;
} else if (const auto cloudDraft = history->cloudDraft(0)) {
return cloudDraft->msgId.bare;
return cloudDraft->reply.messageId.msg.bare;
} else {
return 0;
}
}();
if (replyTo) {
history->clearCloudDraft(0);
history->clearLocalDraft(0);

peer->session().api().request(
MTPmessages_SaveDraft(
MTP_flags(MTPmessages_SaveDraft::Flags(0)),
MTPint(),
MTPint(),
MTP_inputReplyToStory(MTP_inputUserEmpty(), MTPint()),
history->peer->input,
MTPstring(),
MTPVector<MTPMessageEntity>()
MTPVector<MTPMessageEntity>(),
MTP_inputMediaEmpty()
)).send();
}
return replyTo;
Expand All @@ -118,7 +117,7 @@ void SendAlbumFromItems(HistoryItemsList items, ToSend &&toSend) {

for (const auto &peer : toSend.peers) {
const auto replyTo = FullReplyTo{
.msgId = ReplyToIdFromDraft(peer),
.messageId = FullMsgId(peer->id, ReplyToIdFromDraft(peer)),
};

const auto flags = MTPmessages_SendMultiMedia::Flags(0)
Expand All @@ -128,11 +127,10 @@ void SendAlbumFromItems(HistoryItemsList items, ToSend &&toSend) {
| (toSend.silent
? MTPmessages_SendMultiMedia::Flag::f_silent
: MTPmessages_SendMultiMedia::Flag(0));

api.request(MTPmessages_SendMultiMedia(
MTP_flags(flags),
peer->input,
ReplyToForMTP(&history->owner(), replyTo),
ReplyToForMTP(history, replyTo),
MTP_vector<MTPInputSingleMedia>(medias),
MTP_int(0),
MTP_inputPeerEmpty()
Expand Down Expand Up @@ -169,7 +167,9 @@ void SendExistingMediaFromItem(
? toSend.comment
: PrepareEditText(item);
message.action.options.silent = toSend.silent;
message.action.replyTo.msgId = ReplyToIdFromDraft(peer);
message.action.replyTo.messageId = FullMsgId(
peer->id,
ReplyToIdFromDraft(peer));
if (const auto document = item->media()->document()) {
Api::SendExistingDocument(
std::move(message),
Expand Down

0 comments on commit 9acd3a9

Please sign in to comment.