Full support and build fix.

This commit is contained in:
John Preston
2025-12-18 22:25:12 +04:00
parent 53324d5494
commit 28434f4bee
136 changed files with 681 additions and 692 deletions

View File

@@ -367,7 +367,7 @@ void ApiWrap::savePinnedOrder(Data::Folder *folder) {
const auto &order = _session->data().pinnedChatsOrder(folder);
const auto input = [](Dialogs::Key key) {
if (const auto history = key.history()) {
return MTP_inputDialogPeer(history->peer->input);
return MTP_inputDialogPeer(history->peer->input());
} else if (const auto folder = key.folder()) {
return MTP_inputDialogPeerFolder(MTP_int(folder->id()));
}
@@ -402,7 +402,7 @@ void ApiWrap::savePinnedOrder(not_null<Data::Forum*> forum) {
input);
request(MTPmessages_ReorderPinnedForumTopics(
MTP_flags(MTPmessages_ReorderPinnedForumTopics::Flag::f_force),
forum->peer()->input,
forum->peer()->input(),
MTP_vector(topics)
)).done([=](const MTPUpdates &result) {
applyUpdates(result);
@@ -416,7 +416,7 @@ void ApiWrap::savePinnedOrder(not_null<Data::SavedMessages*> saved) {
const auto &order = _session->data().pinnedChatsOrder(saved);
const auto input = [](Dialogs::Key key) {
if (const auto sublist = key.sublist()) {
return MTP_inputDialogPeer(sublist->sublistPeer()->input);
return MTP_inputDialogPeer(sublist->sublistPeer()->input());
}
Unexpected("Key type in pinnedDialogsOrder().");
};
@@ -445,7 +445,7 @@ void ApiWrap::toggleHistoryArchived(
MTP_vector<MTPInputFolderPeer>(
1,
MTP_inputFolderPeer(
history->peer->input,
history->peer->input(),
MTP_int(archived ? archiveId : 0)))
)).done([=](const MTPUpdates &result) {
applyUpdates(result);
@@ -641,7 +641,7 @@ void ApiWrap::resolveMessageDatas() {
if (!ids.isEmpty()) {
const auto channel = j->first;
const auto requestId = request(MTPchannels_GetMessages(
channel->inputChannel,
channel->inputChannel(),
MTP_vector<MTPInputMessage>(ids)
)).done([=](
const MTPmessages_Messages &result,
@@ -764,7 +764,7 @@ QString ApiWrap::exportDirectMessageLink(
MTP_flags(inRepliesContext
? MTPchannels_ExportMessageLink::Flag::f_thread
: MTPchannels_ExportMessageLink::Flag(0)),
channel->inputChannel,
channel->inputChannel(),
MTP_int(item->id)
)).done([=](const MTPExportedMessageLink &result) {
const auto link = qs(result.data().vlink());
@@ -798,7 +798,7 @@ QString ApiWrap::exportDirectStoryLink(not_null<Data::Story*> story) {
? i->second
: fallback();
request(MTPstories_ExportStoryLink(
peer->input,
peer->input(),
MTP_int(story->id())
)).done([=](const MTPExportedStoryLink &result) {
const auto link = qs(result.data().vlink());
@@ -865,7 +865,7 @@ void ApiWrap::requestMoreDialogs(Data::Folder *folder) {
MTP_int(state->offsetDate),
MTP_int(state->offsetId),
(state->offsetPeer
? state->offsetPeer->input
? state->offsetPeer->input()
: MTP_inputPeerEmpty()),
MTP_int(loadCount),
MTP_long(hash)
@@ -1130,7 +1130,7 @@ void ApiWrap::requestFullPeer(not_null<PeerData*> peer) {
_session->supportHelper().refreshInfo(user);
}
return request(MTPusers_GetFullUser(
user->inputUser
user->inputUser()
)).done([=](const MTPusers_UserFull &result) {
result.match([&](const MTPDusers_userFull &data) {
_session->data().processUsers(data.vusers());
@@ -1140,13 +1140,13 @@ void ApiWrap::requestFullPeer(not_null<PeerData*> peer) {
}).fail(failHandler).send();
} else if (const auto chat = peer->asChat()) {
return request(MTPmessages_GetFullChat(
chat->inputChat
chat->inputChat()
)).done([=](const MTPmessages_ChatFull &result) {
gotChatFull(peer, result);
}).fail(failHandler).send();
} else if (const auto channel = peer->asChannel()) {
return request(MTPchannels_GetFullChannel(
channel->inputChannel
channel->inputChannel()
)).done([=](const MTPmessages_ChatFull &result) {
gotChatFull(peer, result);
migrateDone(channel, channel);
@@ -1224,7 +1224,7 @@ void ApiWrap::requestPeerSettings(not_null<PeerData*> peer) {
return;
}
request(MTPmessages_GetPeerSettings(
peer->input
peer->input()
)).done([=](const MTPmessages_PeerSettings &result) {
result.match([&](const MTPDmessages_peerSettings &data) {
_session->data().processUsers(data.vusers());
@@ -1279,7 +1279,7 @@ void ApiWrap::migrateChat(
}
request(MTPmessages_MigrateChat(
chat->inputChat
chat->inputChat()
)).done([=](const MTPUpdates &result) {
applyUpdates(result);
session().changes().sendNotifications();
@@ -1351,7 +1351,7 @@ void ApiWrap::markContentsRead(
}
for (const auto &channelIds : channelMarkedIds) {
request(MTPchannels_ReadMessageContents(
channelIds.first->inputChannel,
channelIds.first->inputChannel(),
MTP_vector<MTPint>(channelIds.second)
)).send();
}
@@ -1364,7 +1364,7 @@ void ApiWrap::markContentsRead(not_null<HistoryItem*> item) {
const auto ids = MTP_vector<MTPint>(1, MTP_int(item->id));
if (const auto channel = item->history()->peer->asChannel()) {
request(MTPchannels_ReadMessageContents(
channel->inputChannel,
channel->inputChannel(),
ids
)).send();
} else {
@@ -1398,8 +1398,8 @@ void ApiWrap::deleteAllFromParticipantSend(
not_null<ChannelData*> channel,
not_null<PeerData*> from) {
request(MTPchannels_DeleteParticipantHistory(
channel->inputChannel,
from->input
channel->inputChannel(),
from->input()
)).done([=](const MTPmessages_AffectedHistory &result) {
const auto offset = applyAffectedHistory(channel, result);
if (offset > 0) {
@@ -1421,8 +1421,8 @@ void ApiWrap::deleteSublistHistorySend(
not_null<PeerData*> sublistPeer) {
request(MTPmessages_DeleteSavedHistory(
MTP_flags(MTPmessages_DeleteSavedHistory::Flag::f_parent_peer),
parentChat->input,
sublistPeer->input,
parentChat->input(),
sublistPeer->input(),
MTP_int(0), // max_id
MTP_int(0), // min_date
MTP_int(0) // max_date
@@ -1743,7 +1743,7 @@ void ApiWrap::joinChannel(not_null<ChannelData*> channel) {
Data::PeerUpdate::Flag::ChannelAmIn);
} else if (!_channelAmInRequests.contains(channel)) {
const auto requestId = request(MTPchannels_JoinChannel(
channel->inputChannel
channel->inputChannel()
)).done([=](const MTPUpdates &result) {
_channelAmInRequests.remove(channel);
applyUpdates(result);
@@ -1800,7 +1800,7 @@ void ApiWrap::leaveChannel(not_null<ChannelData*> channel) {
Data::PeerUpdate::Flag::ChannelAmIn);
} else if (!_channelAmInRequests.contains(channel)) {
auto requestId = request(MTPchannels_LeaveChannel(
channel->inputChannel
channel->inputChannel()
)).done([=](const MTPUpdates &result) {
_channelAmInRequests.remove(channel);
applyUpdates(result);
@@ -1926,14 +1926,14 @@ void ApiWrap::sendNotifySettingsUpdates() {
for (const auto topic : base::take(_updateNotifyTopics)) {
request(MTPaccount_UpdateNotifySettings(
MTP_inputNotifyForumTopic(
topic->peer()->input,
topic->peer()->input(),
MTP_int(topic->rootId())),
topic->notify().serialize()
)).afterDelay(kSmallDelayMs).send();
}
for (const auto peer : base::take(_updateNotifyPeers)) {
request(MTPaccount_UpdateNotifySettings(
MTP_inputNotifyPeer(peer->input),
MTP_inputNotifyPeer(peer->input()),
peer->notify().serialize()
)).afterDelay(kSmallDelayMs).send();
}
@@ -2012,8 +2012,8 @@ void ApiWrap::deleteConversation(not_null<PeerData*> peer, bool revoke) {
if (const auto chat = peer->asChat()) {
request(MTPmessages_DeleteChatUser(
MTP_flags(0),
chat->inputChat,
_session->user()->inputUser
chat->inputChat(),
_session->user()->inputUser()
)).done([=](const MTPUpdates &result) {
applyUpdates(result);
deleteHistory(peer, false, revoke);
@@ -2206,7 +2206,7 @@ void ApiWrap::saveDraftsToCloud() {
cloudDraft->saveRequestId = request(MTPmessages_SaveDraft(
MTP_flags(flags),
ReplyToForMTP(history, cloudDraft->reply),
history->peer->input,
history->peer->input(),
MTP_string(textWithTags.text),
entities,
Data::WebPageForMTP(
@@ -2382,7 +2382,7 @@ void ApiWrap::resolveWebPages() {
QVector<mtpRequestId> reqsByIndex(idsByChannel.size(), 0);
for (auto i = idsByChannel.cbegin(), e = idsByChannel.cend(); i != e; ++i) {
reqsByIndex[i->second.first] = request(MTPchannels_GetMessages(
i->first->inputChannel,
i->first->inputChannel(),
MTP_vector<MTPInputMessage>(i->second.second)
)).done([=, channel = i->first](
const MTPmessages_Messages &result,
@@ -2511,13 +2511,13 @@ void ApiWrap::refreshFileReference(
};
if (storyId) {
request(MTPstories_GetStoriesByID(
_session->data().peer(storyId.peer)->input,
_session->data().peer(storyId.peer)->input(),
MTP_vector<MTPint>(1, MTP_int(storyId.story))));
} else if (item->isScheduled()) {
const auto realId = _session->scheduledMessages().lookupId(
item);
request(MTPmessages_GetScheduledMessages(
item->history()->peer->input,
item->history()->peer->input(),
MTP_vector<MTPint>(1, MTP_int(realId))));
} else if (item->isSavedMusicItem()) {
const auto user = item->history()->peer->asUser();
@@ -2525,7 +2525,7 @@ void ApiWrap::refreshFileReference(
const auto document = media ? media->document() : nullptr;
if (user && document) {
request(MTPusers_GetSavedMusicByID(
user->inputUser,
user->inputUser(),
MTP_vector<MTPInputDocument>(1, document->mtpInput())));
} else {
fail();
@@ -2540,7 +2540,7 @@ void ApiWrap::refreshFileReference(
MTP_long(0)));
} else if (const auto channel = item->history()->peer->asChannel()) {
request(MTPchannels_GetMessages(
channel->inputChannel,
channel->inputChannel(),
MTP_vector<MTPInputMessage>(
1,
MTP_inputMessageID(MTP_int(item->id)))));
@@ -2556,7 +2556,7 @@ void ApiWrap::refreshFileReference(
}, [&](Data::FileOriginUserPhoto data) {
if (const auto user = _session->data().user(data.userId)) {
request(MTPphotos_GetUserPhotos(
user->inputUser,
user->inputUser(),
MTP_int(-1),
MTP_long(data.photoId),
MTP_int(1)));
@@ -2565,7 +2565,7 @@ void ApiWrap::refreshFileReference(
}
}, [&](Data::FileOriginFullUser data) {
if (const auto user = _session->data().user(data.userId)) {
request(MTPusers_GetFullUser(user->inputUser));
request(MTPusers_GetFullUser(user->inputUser()));
} else {
fail();
}
@@ -2634,7 +2634,7 @@ void ApiWrap::refreshFileReference(
MTP_int(0)));
}, [&](Data::FileOriginStory data) {
request(MTPstories_GetStoriesByID(
_session->data().peer(data.peer)->input,
_session->data().peer(data.peer)->input(),
MTP_vector<MTPint>(1, MTP_int(data.story))));
}, [&](v::null_t) {
fail();
@@ -2704,7 +2704,7 @@ void ApiWrap::setGroupStickerSet(
megagroup->mgInfo->stickerSet = set;
request(MTPchannels_SetStickers(
megagroup->inputChannel,
megagroup->inputChannel(),
Data::InputStickerSet(set)
)).send();
_session->data().stickers().notifyUpdated(Data::StickersType::Stickers);
@@ -2717,7 +2717,7 @@ void ApiWrap::setGroupEmojiSet(
megagroup->mgInfo->emojiSet = set;
request(MTPchannels_SetEmojiStickers(
megagroup->inputChannel,
megagroup->inputChannel(),
Data::InputStickerSet(set)
)).send();
_session->changes().peerUpdated(
@@ -3127,7 +3127,7 @@ void ApiWrap::requestMessageAfterDate(
};
if (topicRootId) {
send(MTPmessages_GetReplies(
peer->input,
peer->input(),
MTP_int(topicRootId),
MTP_int(offsetId),
MTP_int(offsetDate),
@@ -3139,8 +3139,8 @@ void ApiWrap::requestMessageAfterDate(
} else if (monoforumPeerId) {
send(MTPmessages_GetSavedHistory(
MTP_flags(MTPmessages_GetSavedHistory::Flag::f_parent_peer),
peer->input,
session().data().peer(monoforumPeerId)->input,
peer->input(),
session().data().peer(monoforumPeerId)->input(),
MTP_int(offsetId),
MTP_int(offsetDate),
MTP_int(addOffset),
@@ -3150,7 +3150,7 @@ void ApiWrap::requestMessageAfterDate(
MTP_long(historyHash)));
} else {
send(MTPmessages_GetHistory(
peer->input,
peer->input(),
MTP_int(offsetId),
MTP_int(offsetDate),
MTP_int(addOffset),
@@ -3537,19 +3537,19 @@ void ApiWrap::forwardMessages(
histories.sendRequest(history, requestType, [=](Fn<void()> finish) {
history->sendRequestId = request(MTPmessages_ForwardMessages(
MTP_flags(oneFlags),
forwardFrom->input,
forwardFrom->input(),
MTP_vector<MTPint>(ids),
MTP_vector<MTPlong>(randomIds),
peer->input,
peer->input(),
MTP_int(topMsgId),
(action.options.suggest
? ReplyToForMTP(history, action.replyTo)
: monoforumPeer
? MTP_inputReplyToMonoForum(monoforumPeer->input)
? MTP_inputReplyToMonoForum(monoforumPeer->input())
: MTPInputReplyTo()),
MTP_int(action.options.scheduled),
MTP_int(action.options.scheduleRepeatPeriod),
(sendAs ? sendAs->input : MTP_inputPeerEmpty()),
(sendAs ? sendAs->input() : MTP_inputPeerEmpty()),
Data::ShortcutIdToMTP(_session, action.options.shortcutId),
MTP_long(action.options.effectId),
MTPint(), // video_timestamp
@@ -3925,7 +3925,7 @@ void ApiWrap::sendShortcutMessages(
auto ids = QVector<MTPint>();
auto randomIds = QVector<MTPlong>();
request(MTPmessages_SendQuickReplyMessages(
peer->input,
peer->input(),
MTP_int(id),
MTP_vector<MTPint>(ids),
MTP_vector<MTPlong>(randomIds)
@@ -4150,7 +4150,7 @@ void ApiWrap::sendMessage(
randomId,
Data::Histories::PrepareMessage<MTPmessages_SendMedia>(
MTP_flags(mediaFlags),
peer->input,
peer->input(),
Data::Histories::ReplyToPlaceholder(),
Data::WebPageForMTP(message.webPage, true),
msgText,
@@ -4159,7 +4159,7 @@ void ApiWrap::sendMessage(
sentEntities,
MTP_int(action.options.scheduled),
MTP_int(action.options.scheduleRepeatPeriod),
(sendAs ? sendAs->input : MTP_inputPeerEmpty()),
(sendAs ? sendAs->input() : MTP_inputPeerEmpty()),
mtpShortcut,
MTP_long(action.options.effectId),
MTP_long(starsPaid),
@@ -4172,7 +4172,7 @@ void ApiWrap::sendMessage(
randomId,
Data::Histories::PrepareMessage<MTPmessages_SendMessage>(
MTP_flags(sendFlags),
peer->input,
peer->input(),
Data::Histories::ReplyToPlaceholder(),
msgText,
MTP_long(randomId),
@@ -4180,7 +4180,7 @@ void ApiWrap::sendMessage(
sentEntities,
MTP_int(action.options.scheduled),
MTP_int(action.options.scheduleRepeatPeriod),
(sendAs ? sendAs->input : MTP_inputPeerEmpty()),
(sendAs ? sendAs->input() : MTP_inputPeerEmpty()),
mtpShortcut,
MTP_long(action.options.effectId),
MTP_long(starsPaid),
@@ -4224,8 +4224,8 @@ void ApiWrap::sendBotStart(
info->startToken = QString();
}
request(MTPmessages_StartBot(
bot->inputUser,
chat ? chat->input : MTP_inputPeerEmpty(),
bot->inputUser(),
chat ? chat->input() : MTP_inputPeerEmpty(),
MTP_long(randomId),
MTP_string(token)
)).done([=](const MTPUpdates &result) {
@@ -4320,13 +4320,13 @@ void ApiWrap::sendInlineResult(
randomId,
Data::Histories::PrepareMessage<MTPmessages_SendInlineBotResult>(
MTP_flags(sendFlags),
peer->input,
peer->input(),
Data::Histories::ReplyToPlaceholder(),
MTP_long(randomId),
MTP_long(data->getQueryId()),
MTP_string(data->getId()),
MTP_int(action.options.scheduled),
(sendAs ? sendAs->input : MTP_inputPeerEmpty()),
(sendAs ? sendAs->input() : MTP_inputPeerEmpty()),
Data::ShortcutIdToMTP(_session, action.options.shortcutId),
MTP_long(starsPaid)
), [=](const MTPUpdates &result, const MTP::Response &response) {
@@ -4361,7 +4361,7 @@ void ApiWrap::uploadAlbumMedia(
request(MTPmessages_UploadMedia(
MTP_flags(0),
MTPstring(), // business_connection_id
item->history()->peer->input,
item->history()->peer->input(),
media
)).done([=](const MTPMessageMedia &result) {
const auto item = _session->data().message(localId);
@@ -4505,7 +4505,7 @@ void ApiWrap::sendMediaWithRandomId(
randomId,
Data::Histories::PrepareMessage<MTPmessages_SendMedia>(
MTP_flags(flags),
peer->input,
peer->input(),
Data::Histories::ReplyToPlaceholder(),
(options.price
? MTPInputMedia(MTP_inputMediaPaidMedia(
@@ -4520,7 +4520,7 @@ void ApiWrap::sendMediaWithRandomId(
sentEntities,
MTP_int(options.scheduled),
MTP_int(options.scheduleRepeatPeriod),
(options.sendAs ? options.sendAs->input : MTP_inputPeerEmpty()),
(options.sendAs ? options.sendAs->input() : MTP_inputPeerEmpty()),
Data::ShortcutIdToMTP(_session, options.shortcutId),
MTP_long(options.effectId),
MTP_long(starsPaid),
@@ -4595,7 +4595,7 @@ void ApiWrap::sendMultiPaidMedia(
randomId,
Data::Histories::PrepareMessage<MTPmessages_SendMedia>(
MTP_flags(flags),
peer->input,
peer->input(),
Data::Histories::ReplyToPlaceholder(),
MTP_inputMediaPaidMedia(
MTP_flags(0),
@@ -4608,7 +4608,7 @@ void ApiWrap::sendMultiPaidMedia(
sentEntities,
MTP_int(options.scheduled),
MTP_int(options.scheduleRepeatPeriod),
(options.sendAs ? options.sendAs->input : MTP_inputPeerEmpty()),
(options.sendAs ? options.sendAs->input() : MTP_inputPeerEmpty()),
Data::ShortcutIdToMTP(_session, options.shortcutId),
MTP_long(options.effectId),
MTP_long(starsPaid),
@@ -4734,12 +4734,12 @@ void ApiWrap::sendAlbumIfReady(not_null<SendingAlbum*> album) {
uint64(0), // randomId
Data::Histories::PrepareMessage<MTPmessages_SendMultiMedia>(
MTP_flags(flags),
peer->input,
peer->input(),
Data::Histories::ReplyToPlaceholder(),
MTP_vector<MTPInputSingleMedia>(medias),
MTP_int(album->options.scheduled),
//MTP_int(album->options.scheduleRepeatPeriod),
(sendAs ? sendAs->input : MTP_inputPeerEmpty()),
(sendAs ? sendAs->input() : MTP_inputPeerEmpty()),
Data::ShortcutIdToMTP(_session, album->options.shortcutId),
MTP_long(album->options.effectId),
MTP_long(starsPaid)
@@ -4821,7 +4821,7 @@ void ApiWrap::requestBotCommonGroups(
};
const auto limit = 100;
request(MTPmessages_GetCommonChats(
bot->inputUser,
bot->inputUser(),
MTP_long(0), // max_id
MTP_int(limit)
)).done([=](const MTPmessages_Chats &result) {