Full support and build fix.
This commit is contained in:
@@ -126,7 +126,7 @@ void ChatCreateDone(
|
||||
void MustBePublicDestroy(not_null<ChannelData*> channel) {
|
||||
const auto session = &channel->session();
|
||||
session->api().request(MTPchannels_DeleteChannel(
|
||||
channel->inputChannel
|
||||
channel->inputChannel()
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
session->api().applyUpdates(result);
|
||||
}).send();
|
||||
@@ -735,7 +735,7 @@ void GroupInfoBox::createGroup(
|
||||
auto user = peer->asUser();
|
||||
Assert(user != nullptr);
|
||||
if (!user->isSelf()) {
|
||||
inputs.push_back(user->inputUser);
|
||||
inputs.push_back(user->inputUser());
|
||||
}
|
||||
}
|
||||
_creationRequestId = _api.request(MTPmessages_CreateChat(
|
||||
@@ -1034,7 +1034,7 @@ void SetupChannelBox::prepare() {
|
||||
setMouseTracking(true);
|
||||
|
||||
_checkRequestId = _api.request(MTPchannels_CheckUsername(
|
||||
_channel->inputChannel,
|
||||
_channel->inputChannel(),
|
||||
MTP_string("preston")
|
||||
)).fail([=](const MTP::Error &error) {
|
||||
_checkRequestId = 0;
|
||||
@@ -1281,7 +1281,7 @@ void SetupChannelBox::save() {
|
||||
const auto saveUsername = [&](const QString &link) {
|
||||
_sentUsername = link;
|
||||
_saveRequestId = _api.request(MTPchannels_UpdateUsername(
|
||||
_channel->inputChannel,
|
||||
_channel->inputChannel(),
|
||||
MTP_string(_sentUsername)
|
||||
)).done([=] {
|
||||
const auto done = _done;
|
||||
@@ -1365,7 +1365,7 @@ void SetupChannelBox::check() {
|
||||
if (link.size() >= Ui::EditPeer::kMinUsernameLength) {
|
||||
_checkUsername = link;
|
||||
_checkRequestId = _api.request(MTPchannels_CheckUsername(
|
||||
_channel->inputChannel,
|
||||
_channel->inputChannel(),
|
||||
MTP_string(link)
|
||||
)).done([=](const MTPBool &result) {
|
||||
_checkRequestId = 0;
|
||||
|
||||
@@ -337,7 +337,7 @@ void BackgroundBox::resetForPeer() {
|
||||
const auto api = &_controller->session().api();
|
||||
api->request(MTPmessages_SetChatWallPaper(
|
||||
MTP_flags(0),
|
||||
_forPeer->input,
|
||||
_forPeer->input(),
|
||||
MTPInputWallPaper(),
|
||||
MTPWallPaperSettings(),
|
||||
MTPint()
|
||||
|
||||
@@ -668,7 +668,7 @@ void BackgroundPreviewBox::setExistingForPeer(
|
||||
| (_fromMessageId ? Flag() : Flag::f_wallpaper)
|
||||
| (both ? Flag::f_for_both : Flag())
|
||||
| Flag::f_settings),
|
||||
_forPeer->input,
|
||||
_forPeer->input(),
|
||||
paper.mtpInput(&_controller->session()),
|
||||
paper.mtpSettings(),
|
||||
MTP_int(_fromMessageId.msg)
|
||||
|
||||
@@ -634,8 +634,8 @@ void DeleteMessagesBox::deleteAndClear() {
|
||||
if (_reportSpam->checked()) {
|
||||
_moderateInChannel->session().api().request(
|
||||
MTPchannels_ReportSpam(
|
||||
_moderateInChannel->inputChannel,
|
||||
_moderateFrom->input,
|
||||
_moderateInChannel->inputChannel(),
|
||||
_moderateFrom->input(),
|
||||
MTP_vector<MTPint>(1, MTP_int(_ids[0].msg)))
|
||||
).send();
|
||||
}
|
||||
|
||||
@@ -1015,7 +1015,7 @@ void ExportFilterLink(
|
||||
const auto front = peers.front();
|
||||
const auto session = &front->session();
|
||||
auto mtpPeers = peers | ranges::views::transform(
|
||||
[](not_null<PeerData*> peer) { return MTPInputPeer(peer->input); }
|
||||
[](not_null<PeerData*> peer) { return MTPInputPeer(peer->input()); }
|
||||
) | ranges::to<QVector<MTPInputPeer>>();
|
||||
session->api().request(MTPchatlists_ExportChatlistInvite(
|
||||
MTP_inputChatlistDialogFilter(MTP_int(id)),
|
||||
@@ -1048,7 +1048,7 @@ void EditLinkChats(
|
||||
const auto front = peers.front();
|
||||
const auto session = &front->session();
|
||||
auto mtpPeers = peers | ranges::views::transform(
|
||||
[](not_null<PeerData*> peer) { return MTPInputPeer(peer->input); }
|
||||
[](not_null<PeerData*> peer) { return MTPInputPeer(peer->input()); }
|
||||
) | ranges::to<QVector<MTPInputPeer>>();
|
||||
session->api().request(MTPchatlists_EditExportedInvite(
|
||||
MTP_flags(MTPchatlists_EditExportedInvite::Flag::f_peers),
|
||||
|
||||
@@ -280,8 +280,8 @@ void CreateModerateMessagesBox(
|
||||
}) | ranges::to<QVector<MTPint>>();
|
||||
c->session().api().request(
|
||||
MTPchannels_ReportSpam(
|
||||
c->inputChannel,
|
||||
p->input,
|
||||
c->inputChannel(),
|
||||
p->input(),
|
||||
MTP_vector<MTPint>(std::move(filtered)))
|
||||
).send();
|
||||
});
|
||||
|
||||
@@ -995,7 +995,7 @@ void ChooseTopicSearchController::searchQuery(const QString &query) {
|
||||
void ChooseTopicSearchController::searchOnServer() {
|
||||
_requestId = _api.request(MTPmessages_GetForumTopics(
|
||||
MTP_flags(MTPmessages_GetForumTopics::Flag::f_q),
|
||||
_forum->peer()->input,
|
||||
_forum->peer()->input(),
|
||||
MTP_string(_query),
|
||||
MTP_int(_offsetDate),
|
||||
MTP_int(_offsetId),
|
||||
|
||||
@@ -163,8 +163,8 @@ void AddBotToGroupBoxController::requestExistingRights(
|
||||
_bot->session().api().request(_existingRightsRequestId).cancel();
|
||||
_existingRightsRequestId = _bot->session().api().request(
|
||||
MTPchannels_GetParticipant(
|
||||
_existingRightsChannel->inputChannel,
|
||||
_bot->input)
|
||||
_existingRightsChannel->inputChannel(),
|
||||
_bot->input())
|
||||
).done([=](const MTPchannels_ChannelParticipant &result) {
|
||||
result.match([&](const MTPDchannels_channelParticipant &data) {
|
||||
channel->owner().processUsers(data.vusers());
|
||||
|
||||
@@ -1330,7 +1330,7 @@ void AddSpecialBoxController::loadMoreRows() {
|
||||
const auto channel = _peer->asChannel();
|
||||
|
||||
_loadRequestId = _api.request(MTPchannels_GetParticipants(
|
||||
channel->inputChannel,
|
||||
channel->inputChannel(),
|
||||
MTP_channelParticipantsRecent(),
|
||||
MTP_int(_offset),
|
||||
MTP_int(perPage),
|
||||
@@ -1393,8 +1393,8 @@ bool AddSpecialBoxController::checkInfoLoaded(
|
||||
// We don't know what this user status is in the group.
|
||||
const auto channel = _peer->asChannel();
|
||||
_api.request(MTPchannels_GetParticipant(
|
||||
channel->inputChannel,
|
||||
participant->input
|
||||
channel->inputChannel(),
|
||||
participant->input()
|
||||
)).done([=](const MTPchannels_ChannelParticipant &result) {
|
||||
result.match([&](const MTPDchannels_channelParticipant &data) {
|
||||
channel->owner().processUsers(data.vusers());
|
||||
@@ -1800,7 +1800,7 @@ void AddSpecialBoxSearchController::requestParticipants() {
|
||||
const auto channel = _peer->asChannel();
|
||||
|
||||
_requestId = _api.request(MTPchannels_GetParticipants(
|
||||
channel->inputChannel,
|
||||
channel->inputChannel(),
|
||||
MTP_channelParticipantsSearch(MTP_string(_query)),
|
||||
MTP_int(_offset),
|
||||
MTP_int(perPage),
|
||||
|
||||
@@ -92,7 +92,7 @@ void SendRequest(
|
||||
user->session().api().request(MTPcontacts_AddContact(
|
||||
MTP_flags(Flag::f_note
|
||||
| (sharePhone ? Flag::f_add_phone_privacy_exception : Flag(0))),
|
||||
user->inputUser,
|
||||
user->inputUser(),
|
||||
MTP_string(first),
|
||||
MTP_string(last),
|
||||
MTP_string(phone),
|
||||
@@ -688,7 +688,7 @@ void Controller::setupDeleteContactButton() {
|
||||
const auto deleteSure = [=](Fn<void()> &&close) {
|
||||
close();
|
||||
_user->session().api().request(MTPcontacts_DeleteContacts(
|
||||
MTP_vector<MTPInputUser>(1, _user->inputUser)
|
||||
MTP_vector<MTPInputUser>(1, _user->inputUser())
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
_user->session().api().applyUpdates(result);
|
||||
_box->closeBox();
|
||||
|
||||
@@ -565,7 +565,7 @@ void EditForumTopicBox(
|
||||
state->requestId = api->request(MTPmessages_EditForumTopic(
|
||||
MTP_flags(Flag::f_title
|
||||
| (topic->isGeneral() ? Flag() : Flag::f_icon_emoji_id)),
|
||||
topic->peer()->input,
|
||||
topic->peer()->input(),
|
||||
MTP_int(rootId),
|
||||
MTP_string(title->getLastText().trimmed()),
|
||||
MTP_long(state->iconId.current()),
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace {
|
||||
) | rpl::on_next([=](bool toggled) {
|
||||
megagroup->session().api().request(
|
||||
MTPchannels_ToggleParticipantsHidden(
|
||||
megagroup->inputChannel,
|
||||
megagroup->inputChannel(),
|
||||
MTP_bool(toggled)
|
||||
)
|
||||
).done([=](const MTPUpdates &result) {
|
||||
|
||||
@@ -592,7 +592,7 @@ void EditAdminBox::transferOwnership() {
|
||||
}
|
||||
|
||||
const auto channel = peer()->isChannel()
|
||||
? peer()->asChannel()->inputChannel
|
||||
? peer()->asChannel()->inputChannel()
|
||||
: MTP_inputChannelEmpty();
|
||||
const auto api = &peer()->session().api();
|
||||
api->cloudPassword().reload();
|
||||
@@ -680,8 +680,8 @@ void EditAdminBox::sendTransferRequestFrom(
|
||||
const auto user = this->user();
|
||||
const auto api = &channel->session().api();
|
||||
_transferRequestId = api->request(MTPchannels_EditCreator(
|
||||
channel->inputChannel,
|
||||
user->inputUser,
|
||||
channel->inputChannel(),
|
||||
user->inputUser(),
|
||||
result.result
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
api->applyUpdates(result);
|
||||
|
||||
@@ -57,8 +57,8 @@ void RemoveAdmin(
|
||||
Fn<void()> onFail) {
|
||||
const auto newRights = MTP_chatAdminRights(MTP_flags(0));
|
||||
channel->session().api().request(MTPchannels_EditAdmin(
|
||||
channel->inputChannel,
|
||||
user->inputUser,
|
||||
channel->inputChannel(),
|
||||
user->inputUser(),
|
||||
newRights,
|
||||
MTP_string(QString())
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
@@ -81,8 +81,8 @@ void AddChatParticipant(
|
||||
Fn<void()> onDone,
|
||||
Fn<void()> onFail) {
|
||||
chat->session().api().request(MTPmessages_AddChatUser(
|
||||
chat->inputChat,
|
||||
user->inputUser,
|
||||
chat->inputChat(),
|
||||
user->inputUser(),
|
||||
MTP_int(kForwardMessagesOnAdd)
|
||||
)).done([=](const MTPmessages_InvitedUsers &result) {
|
||||
const auto &data = result.data();
|
||||
@@ -111,8 +111,8 @@ void SaveChatAdmin(
|
||||
Fn<void()> onFail,
|
||||
bool retryOnNotParticipant = true) {
|
||||
chat->session().api().request(MTPmessages_EditChatAdmin(
|
||||
chat->inputChat,
|
||||
user->inputUser,
|
||||
chat->inputChat(),
|
||||
user->inputUser(),
|
||||
MTP_bool(isAdmin)
|
||||
)).done([=] {
|
||||
chat->applyEditAdmin(user, isAdmin);
|
||||
@@ -150,8 +150,8 @@ void SaveChannelAdmin(
|
||||
Fn<void()> onDone,
|
||||
Fn<void()> onFail) {
|
||||
channel->session().api().request(MTPchannels_EditAdmin(
|
||||
channel->inputChannel,
|
||||
user->inputUser,
|
||||
channel->inputChannel(),
|
||||
user->inputUser(),
|
||||
AdminRightsToMTP(newRights),
|
||||
MTP_string(rank)
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
@@ -175,8 +175,8 @@ void SaveChatParticipantKick(
|
||||
Fn<void()> onFail) {
|
||||
chat->session().api().request(MTPmessages_DeleteChatUser(
|
||||
MTP_flags(0),
|
||||
chat->inputChat,
|
||||
user->inputUser
|
||||
chat->inputChat(),
|
||||
user->inputUser()
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
chat->session().api().applyUpdates(result);
|
||||
if (onDone) {
|
||||
@@ -1515,7 +1515,7 @@ void ParticipantsBoxController::loadMoreRows() {
|
||||
const auto participantsHash = uint64(0);
|
||||
|
||||
_loadRequestId = _api.request(MTPchannels_GetParticipants(
|
||||
channel->inputChannel,
|
||||
channel->inputChannel(),
|
||||
filter,
|
||||
MTP_int(_offset),
|
||||
MTP_int(perPage),
|
||||
@@ -2209,7 +2209,7 @@ void ParticipantsBoxController::subscribeToCreatorChange(
|
||||
const auto weak = base::make_weak(this);
|
||||
const auto api = &channel->session().api();
|
||||
api->request(MTPchannels_GetParticipants(
|
||||
channel->inputChannel,
|
||||
channel->inputChannel(),
|
||||
MTP_channelParticipantsRecent(),
|
||||
MTP_int(0), // offset
|
||||
MTP_int(channel->session().serverConfig().chatSizeMax),
|
||||
@@ -2356,7 +2356,7 @@ bool ParticipantsBoxSearchController::loadMoreRows() {
|
||||
const auto participantsHash = uint64(0);
|
||||
|
||||
_requestId = _api.request(MTPchannels_GetParticipants(
|
||||
_channel->inputChannel,
|
||||
_channel->inputChannel(),
|
||||
filter,
|
||||
MTP_int(_offset),
|
||||
MTP_int(perPage),
|
||||
|
||||
@@ -602,7 +602,7 @@ void Set(
|
||||
: Flag(0))
|
||||
| Flag::f_background_emoji_id
|
||||
| (values.forProfile ? Flag::f_for_profile : Flag(0))),
|
||||
channel->inputChannel,
|
||||
channel->inputChannel(),
|
||||
MTP_int(values.colorIndex),
|
||||
MTP_long(values.backgroundEmojiId)));
|
||||
}
|
||||
@@ -2776,7 +2776,7 @@ void CheckBoostLevel(
|
||||
Fn<std::optional<Ui::AskBoostReason>(int level)> askMore,
|
||||
Fn<void()> cancel) {
|
||||
peer->session().api().request(MTPpremium_GetBoostsStatus(
|
||||
peer->input
|
||||
peer->input()
|
||||
)).done([=](const MTPpremium_BoostsStatus &result) {
|
||||
const auto &data = result.data();
|
||||
if (const auto channel = peer->asChannel()) {
|
||||
|
||||
@@ -182,7 +182,7 @@ void SaveDefaultRestrictions(
|
||||
|
||||
const auto requestId = api->request(
|
||||
MTPmessages_EditChatDefaultBannedRights(
|
||||
peer->input,
|
||||
peer->input(),
|
||||
RestrictionsToMTP({ rights, 0 }))
|
||||
).done([=](const MTPUpdates &result) {
|
||||
api->clearModifyRequest(key);
|
||||
@@ -214,7 +214,7 @@ void SaveSlowmodeSeconds(
|
||||
const auto key = Api::RequestKey("slowmode_seconds", channel->id);
|
||||
|
||||
const auto requestId = api->request(MTPchannels_ToggleSlowMode(
|
||||
channel->inputChannel,
|
||||
channel->inputChannel(),
|
||||
MTP_int(seconds)
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
api->clearModifyRequest(key);
|
||||
@@ -249,7 +249,7 @@ void SaveStarsPerMessage(
|
||||
MTP_flags(broadcastAllowed
|
||||
? Flag::f_broadcast_messages_allowed
|
||||
: Flag(0)),
|
||||
channel->inputChannel,
|
||||
channel->inputChannel(),
|
||||
MTP_long(starsPerMessage)
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
api->clearModifyRequest(key);
|
||||
@@ -284,7 +284,7 @@ void SaveBoostsUnrestrict(
|
||||
const auto key = Api::RequestKey("boosts_unrestrict", channel->id);
|
||||
const auto requestId = api->request(
|
||||
MTPchannels_SetBoostsToUnblockRestrictions(
|
||||
channel->inputChannel,
|
||||
channel->inputChannel(),
|
||||
MTP_int(boostsUnrestrict))
|
||||
).done([=](const MTPUpdates &result) {
|
||||
api->clearModifyRequest(key);
|
||||
@@ -1718,7 +1718,7 @@ void Controller::editReactions() {
|
||||
}
|
||||
_controls.levelRequested = true;
|
||||
_api.request(MTPpremium_GetBoostsStatus(
|
||||
_peer->input
|
||||
_peer->input()
|
||||
)).done([=](const MTPpremium_BoostsStatus &result) {
|
||||
_controls.levelRequested = false;
|
||||
if (const auto channel = _peer->asChannel()) {
|
||||
@@ -2284,7 +2284,7 @@ void Controller::saveUsernamesOrder() {
|
||||
}
|
||||
if (_savingData.usernamesOrder->empty()) {
|
||||
_api.request(MTPchannels_DeactivateAllUsernames(
|
||||
channel->inputChannel
|
||||
channel->inputChannel()
|
||||
)).done([=] {
|
||||
channel->setUsernames(channel->editableUsername().isEmpty()
|
||||
? Data::Usernames()
|
||||
@@ -2341,7 +2341,7 @@ void Controller::saveUsername() {
|
||||
|
||||
const auto newUsername = (*_savingData.username);
|
||||
_api.request(MTPchannels_UpdateUsername(
|
||||
channel->inputChannel,
|
||||
channel->inputChannel(),
|
||||
MTP_string(newUsername)
|
||||
)).done([=] {
|
||||
channel->setName(
|
||||
@@ -2393,11 +2393,11 @@ void Controller::saveDiscussionLink() {
|
||||
}
|
||||
|
||||
const auto input = *_savingData.discussionLink
|
||||
? (*_savingData.discussionLink)->inputChannel
|
||||
? (*_savingData.discussionLink)->inputChannel()
|
||||
: MTP_inputChannelEmpty();
|
||||
_api.request(MTPchannels_SetDiscussionGroup(
|
||||
(channel->isBroadcast() ? channel->inputChannel : input),
|
||||
(channel->isBroadcast() ? input : channel->inputChannel)
|
||||
(channel->isBroadcast() ? channel->inputChannel() : input),
|
||||
(channel->isBroadcast() ? input : channel->inputChannel())
|
||||
)).done([=] {
|
||||
channel->setDiscussionLink(*_savingData.discussionLink);
|
||||
continueSave();
|
||||
@@ -2462,14 +2462,14 @@ void Controller::saveTitle() {
|
||||
|
||||
if (const auto channel = _peer->asChannel()) {
|
||||
_api.request(MTPchannels_EditTitle(
|
||||
channel->inputChannel,
|
||||
channel->inputChannel(),
|
||||
MTP_string(*_savingData.title)
|
||||
)).done(std::move(onDone)
|
||||
).fail(std::move(onFail)
|
||||
).send();
|
||||
} else if (const auto chat = _peer->asChat()) {
|
||||
_api.request(MTPmessages_EditChatTitle(
|
||||
chat->inputChat,
|
||||
chat->inputChat(),
|
||||
MTP_string(*_savingData.title)
|
||||
)).done(std::move(onDone)
|
||||
).fail(std::move(onFail)
|
||||
@@ -2477,7 +2477,7 @@ void Controller::saveTitle() {
|
||||
} else if (_isBot) {
|
||||
_api.request(MTPbots_GetBotInfo(
|
||||
MTP_flags(MTPbots_GetBotInfo::Flag::f_bot),
|
||||
_peer->asUser()->inputUser,
|
||||
_peer->asUser()->inputUser(),
|
||||
MTPstring() // Lang code.
|
||||
)).done([=](const MTPbots_BotInfo &result) {
|
||||
const auto was = qs(result.data().vname());
|
||||
@@ -2488,7 +2488,7 @@ void Controller::saveTitle() {
|
||||
using Flag = MTPbots_SetBotInfo::Flag;
|
||||
_api.request(MTPbots_SetBotInfo(
|
||||
MTP_flags(Flag::f_bot | Flag::f_name),
|
||||
_peer->asUser()->inputUser,
|
||||
_peer->asUser()->inputUser(),
|
||||
MTPstring(), // Lang code.
|
||||
MTP_string(now), // Name.
|
||||
MTPstring(), // About.
|
||||
@@ -2516,7 +2516,7 @@ void Controller::saveDescription() {
|
||||
if (_isBot) {
|
||||
_api.request(MTPbots_GetBotInfo(
|
||||
MTP_flags(MTPbots_GetBotInfo::Flag::f_bot),
|
||||
_peer->asUser()->inputUser,
|
||||
_peer->asUser()->inputUser(),
|
||||
MTPstring() // Lang code.
|
||||
)).done([=](const MTPbots_BotInfo &result) {
|
||||
const auto was = qs(result.data().vabout());
|
||||
@@ -2527,7 +2527,7 @@ void Controller::saveDescription() {
|
||||
using Flag = MTPbots_SetBotInfo::Flag;
|
||||
_api.request(MTPbots_SetBotInfo(
|
||||
MTP_flags(Flag::f_bot | Flag::f_about),
|
||||
_peer->asUser()->inputUser,
|
||||
_peer->asUser()->inputUser(),
|
||||
MTPstring(), // Lang code.
|
||||
MTPstring(), // Name.
|
||||
MTP_string(now), // About.
|
||||
@@ -2544,7 +2544,7 @@ void Controller::saveDescription() {
|
||||
return;
|
||||
}
|
||||
_api.request(MTPmessages_EditChatAbout(
|
||||
_peer->input,
|
||||
_peer->input(),
|
||||
MTP_string(*_savingData.description)
|
||||
)).done([=] {
|
||||
successCallback();
|
||||
@@ -2620,7 +2620,7 @@ void Controller::togglePreHistoryHidden(
|
||||
done();
|
||||
};
|
||||
_api.request(MTPchannels_TogglePreHistoryHidden(
|
||||
channel->inputChannel,
|
||||
channel->inputChannel(),
|
||||
MTP_bool(hidden)
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
channel->session().api().applyUpdates(result);
|
||||
@@ -2658,7 +2658,7 @@ void Controller::saveForum() {
|
||||
return;
|
||||
}
|
||||
_api.request(MTPchannels_ToggleForum(
|
||||
channel->inputChannel,
|
||||
channel->inputChannel(),
|
||||
MTP_bool(*_savingData.forum),
|
||||
MTP_bool(*_savingData.forum && *_savingData.forumTabs)
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
@@ -2685,7 +2685,7 @@ void Controller::saveAutotranslate() {
|
||||
return continueSave();
|
||||
}
|
||||
_api.request(MTPchannels_ToggleAutotranslation(
|
||||
channel->inputChannel,
|
||||
channel->inputChannel(),
|
||||
MTP_bool(*_savingData.autotranslate)
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
channel->session().api().applyUpdates(result);
|
||||
@@ -2721,7 +2721,7 @@ void Controller::saveSignatures() {
|
||||
| (*_savingData.signatureProfiles
|
||||
? Flag::f_profiles_enabled
|
||||
: Flag())),
|
||||
channel->inputChannel
|
||||
channel->inputChannel()
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
channel->session().api().applyUpdates(result);
|
||||
continueSave();
|
||||
@@ -2741,7 +2741,7 @@ void Controller::saveForwards() {
|
||||
return continueSave();
|
||||
}
|
||||
_api.request(MTPmessages_ToggleNoForwards(
|
||||
_peer->input,
|
||||
_peer->input(),
|
||||
MTP_bool(*_savingData.noForwards)
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
_peer->session().api().applyUpdates(result);
|
||||
@@ -2764,7 +2764,7 @@ void Controller::saveJoinToWrite() {
|
||||
return continueSave();
|
||||
}
|
||||
_api.request(MTPchannels_ToggleJoinToSend(
|
||||
_peer->asChannel()->inputChannel,
|
||||
_peer->asChannel()->inputChannel(),
|
||||
MTP_bool(*_savingData.joinToWrite)
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
_peer->session().api().applyUpdates(result);
|
||||
@@ -2787,7 +2787,7 @@ void Controller::saveRequestToJoin() {
|
||||
return continueSave();
|
||||
}
|
||||
_api.request(MTPchannels_ToggleJoinRequest(
|
||||
_peer->asChannel()->inputChannel,
|
||||
_peer->asChannel()->inputChannel(),
|
||||
MTP_bool(*_savingData.requestToJoin)
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
_peer->session().api().applyUpdates(result);
|
||||
@@ -2847,7 +2847,7 @@ void Controller::deleteChannel() {
|
||||
session->api().deleteConversation(chat, false);
|
||||
}
|
||||
session->api().request(MTPchannels_DeleteChannel(
|
||||
channel->inputChannel
|
||||
channel->inputChannel()
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
session->api().applyUpdates(result);
|
||||
//}).fail([=](const MTP::Error &error) {
|
||||
|
||||
@@ -902,11 +902,11 @@ void Controller::loadMoreRows() {
|
||||
_requestId = _api.request(MTPmessages_GetChatInviteImporters(
|
||||
MTP_flags(Flag::f_link
|
||||
| (_role == Role::Requested ? Flag::f_requested : Flag(0))),
|
||||
_peer->input,
|
||||
_peer->input(),
|
||||
MTP_string(_link),
|
||||
MTPstring(), // q
|
||||
MTP_int(_lastUser ? _lastUser->date : 0),
|
||||
_lastUser ? _lastUser->user->inputUser : MTP_inputUserEmpty(),
|
||||
_lastUser ? _lastUser->user->inputUser() : MTP_inputUserEmpty(),
|
||||
MTP_int(_lastUser ? kPerPage : kFirstPage)
|
||||
)).done([=](const MTPmessages_ChatInviteImporters &result) {
|
||||
_requestId = 0;
|
||||
|
||||
@@ -803,7 +803,7 @@ void AdminsController::prepare() {
|
||||
return;
|
||||
}
|
||||
_requestId = session().api().request(MTPmessages_GetAdminsWithInvites(
|
||||
_peer->input
|
||||
_peer->input()
|
||||
)).done([=](const MTPmessages_ChatAdminsWithInvites &result) {
|
||||
result.match([&](const MTPDmessages_chatAdminsWithInvites &data) {
|
||||
auto &owner = _peer->owner();
|
||||
|
||||
@@ -1273,7 +1273,7 @@ Fn<void()> AboutGigagroupCallback(
|
||||
}
|
||||
*converting = true;
|
||||
channel->session().api().request(MTPchannels_ConvertToGigagroup(
|
||||
channel->inputChannel
|
||||
channel->inputChannel()
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
channel->session().api().applyUpdates(result);
|
||||
if (const auto strong = weak.get()) {
|
||||
|
||||
@@ -1010,7 +1010,7 @@ void SaveAllowedReactions(
|
||||
MTP_flags(Flag()
|
||||
| (maxCount ? Flag::f_reactions_limit : Flag())
|
||||
| (editPaidEnabled ? Flag::f_paid_enabled : Flag())),
|
||||
peer->input,
|
||||
peer->input(),
|
||||
updated,
|
||||
MTP_int(maxCount),
|
||||
MTP_bool(paidEnabled)
|
||||
|
||||
@@ -362,11 +362,11 @@ void RequestsBoxController::loadMoreRows() {
|
||||
using Flag = MTPmessages_GetChatInviteImporters::Flag;
|
||||
_loadRequestId = _api.request(MTPmessages_GetChatInviteImporters(
|
||||
MTP_flags(Flag::f_requested),
|
||||
_peer->input,
|
||||
_peer->input(),
|
||||
MTPstring(), // link
|
||||
MTPstring(), // q
|
||||
MTP_int(_offsetDate),
|
||||
_offsetUser ? _offsetUser->inputUser : MTP_inputUserEmpty(),
|
||||
_offsetUser ? _offsetUser->inputUser() : MTP_inputUserEmpty(),
|
||||
MTP_int(limit)
|
||||
)).done([=](const MTPmessages_ChatInviteImporters &result) {
|
||||
const auto firstLoad = !_offsetDate;
|
||||
@@ -681,11 +681,11 @@ bool RequestsBoxSearchController::loadMoreRows() {
|
||||
using Flag = MTPmessages_GetChatInviteImporters::Flag;
|
||||
_requestId = _api.request(MTPmessages_GetChatInviteImporters(
|
||||
MTP_flags(Flag::f_requested | Flag::f_q),
|
||||
_peer->input,
|
||||
_peer->input(),
|
||||
MTPstring(), // link
|
||||
MTP_string(_query),
|
||||
MTP_int(_offsetDate),
|
||||
_offsetUser ? _offsetUser->inputUser : MTP_inputUserEmpty(),
|
||||
_offsetUser ? _offsetUser->inputUser() : MTP_inputUserEmpty(),
|
||||
MTP_int(limit)
|
||||
)).done([=](
|
||||
const MTPmessages_ChatInviteImporters &result,
|
||||
|
||||
@@ -553,7 +553,7 @@ void Controller::checkUsernameAvailability() {
|
||||
const auto channel = _peer->migrateToOrMe()->asChannel();
|
||||
const auto username = channel ? channel->editableUsername() : QString();
|
||||
_checkUsernameRequestId = _api.request(MTPchannels_CheckUsername(
|
||||
channel ? channel->inputChannel : MTP_inputChannelEmpty(),
|
||||
channel ? channel->inputChannel() : MTP_inputChannelEmpty(),
|
||||
MTP_string(checking)
|
||||
)).done([=](const MTPBool &result) {
|
||||
_checkUsernameRequestId = 0;
|
||||
|
||||
@@ -58,8 +58,8 @@ void Setup(
|
||||
MTP_flags(Flag::f_bot
|
||||
| Flag::f_enabled
|
||||
| (description.isEmpty() ? Flag() : Flag::f_custom_description)),
|
||||
bot->inputUser,
|
||||
peer->input,
|
||||
bot->inputUser(),
|
||||
peer->input(),
|
||||
MTP_string(description)
|
||||
)).done([=] {
|
||||
done(QString());
|
||||
@@ -74,8 +74,8 @@ void Remove(
|
||||
Fn<void(QString)> done) {
|
||||
bot->session().api().request(MTPbots_SetCustomVerification(
|
||||
MTP_flags(MTPbots_SetCustomVerification::Flag::f_bot),
|
||||
bot->inputUser,
|
||||
peer->input,
|
||||
bot->inputUser(),
|
||||
peer->input(),
|
||||
MTPstring()
|
||||
)).done([=] {
|
||||
done(QString());
|
||||
|
||||
@@ -112,7 +112,7 @@ void PinMessageBox(
|
||||
}
|
||||
state->requestId = api->request(MTPmessages_UpdatePinnedMessage(
|
||||
MTP_flags(flags),
|
||||
peer->input,
|
||||
peer->input(),
|
||||
MTP_int(msgId)
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
peer->session().api().applyUpdates(result);
|
||||
|
||||
@@ -366,11 +366,11 @@ void PublicsController::rowRightActionClicked(not_null<PeerListRow*> row) {
|
||||
}
|
||||
*once = true;
|
||||
peer->session().api().request(MTPchannels_UpdateUsername(
|
||||
peer->asChannel()->inputChannel,
|
||||
peer->asChannel()->inputChannel(),
|
||||
MTP_string()
|
||||
)).done([=] {
|
||||
peer->session().api().request(MTPchannels_DeactivateAllUsernames(
|
||||
peer->asChannel()->inputChannel
|
||||
peer->asChannel()->inputChannel()
|
||||
)).done([=] {
|
||||
closeBox();
|
||||
close();
|
||||
|
||||
@@ -1781,13 +1781,13 @@ ShareBox::SubmitCallback ShareBox::DefaultForwardCallback(
|
||||
threadHistory->sendRequestId = api.request(
|
||||
MTPmessages_ForwardMessages(
|
||||
MTP_flags(sendFlags),
|
||||
history->peer->input,
|
||||
history->peer->input(),
|
||||
MTP_vector<MTPint>(mtpMsgIds),
|
||||
MTP_vector<MTPlong>(generateRandom()),
|
||||
peer->input,
|
||||
peer->input(),
|
||||
MTP_int(topMsgId),
|
||||
(sublistPeer
|
||||
? MTP_inputReplyToMonoForum(sublistPeer->input)
|
||||
? MTP_inputReplyToMonoForum(sublistPeer->input())
|
||||
: MTPInputReplyTo()),
|
||||
MTP_int(options.scheduled),
|
||||
MTP_int(options.scheduleRepeatPeriod),
|
||||
|
||||
@@ -352,7 +352,7 @@ void PlaceAuctionBid(
|
||||
| (passDetails ? Flag::f_peer : Flag())
|
||||
| (passDetails ? Flag::f_message : Flag())
|
||||
| (hideName ? Flag::f_hide_name : Flag())),
|
||||
passDetails ? to->input : MTP_inputPeerEmpty(),
|
||||
passDetails ? to->input() : MTP_inputPeerEmpty(),
|
||||
MTP_long(state.gift->id),
|
||||
MTP_long(amount),
|
||||
MTP_textWithEntities(
|
||||
|
||||
@@ -1475,7 +1475,7 @@ void GiftUpgrade(
|
||||
RequestStarsFormAndSubmit(
|
||||
window->uiShow(),
|
||||
MTP_inputInvoiceStarGiftPrepaidUpgrade(
|
||||
peer->input,
|
||||
peer->input(),
|
||||
MTP_string(giftPrepayUpgradeHash)),
|
||||
std::move(formDone));
|
||||
}
|
||||
@@ -1820,7 +1820,7 @@ void CheckMaybeGiftLocked(
|
||||
window->uiShow(),
|
||||
MTP_inputInvoiceStarGiftTransfer(
|
||||
Api::InputSavedStarGiftId(savedId, unique),
|
||||
peer->input),
|
||||
peer->input()),
|
||||
formReady);
|
||||
} else if (star && star->resale) {
|
||||
const auto id = star->info.id;
|
||||
@@ -4356,7 +4356,7 @@ void SendOfferBuyGift(
|
||||
using Flag = MTPpayments_SendStarGiftOffer::Flag;
|
||||
show->session().api().request(MTPpayments_SendStarGiftOffer(
|
||||
MTP_flags(starsPerMessage ? Flag::f_allow_paid_stars : Flag()),
|
||||
owner->input,
|
||||
owner->input(),
|
||||
MTP_string(unique->slug),
|
||||
StarsAmountToTL(options.price()),
|
||||
MTP_int(options.offerDuration),
|
||||
|
||||
@@ -468,7 +468,7 @@ void TransferGift(
|
||||
// Like when we transfer a gift from Resale tab.
|
||||
session->api().request(MTPpayments_TransferStarGift(
|
||||
Api::InputSavedStarGiftId(savedId, gift),
|
||||
to->input
|
||||
to->input()
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
session->api().applyUpdates(result);
|
||||
formDone(Payments::CheckoutResult::Paid, &result);
|
||||
@@ -492,7 +492,7 @@ void TransferGift(
|
||||
window->uiShow(),
|
||||
MTP_inputInvoiceStarGiftTransfer(
|
||||
Api::InputSavedStarGiftId(savedId, gift),
|
||||
to->input),
|
||||
to->input()),
|
||||
std::move(formDone));
|
||||
}
|
||||
}
|
||||
@@ -541,7 +541,7 @@ void BuyResaleGift(
|
||||
const auto invoice = MTP_inputInvoiceStarGiftResale(
|
||||
MTP_flags((type == CreditsType::Ton) ? Flag::f_ton : Flag()),
|
||||
MTP_string(gift->slug),
|
||||
to->input);
|
||||
to->input());
|
||||
|
||||
Ui::RequestOurForm(show, invoice, [=](
|
||||
uint64 formId,
|
||||
@@ -922,7 +922,7 @@ void SendPeerThemeChangeRequest(
|
||||
|
||||
api->request(MTPmessages_SetChatWallPaper(
|
||||
MTP_flags(0),
|
||||
peer->input,
|
||||
peer->input(),
|
||||
MTPInputWallPaper(),
|
||||
MTPWallPaperSettings(),
|
||||
MTPint()
|
||||
@@ -931,7 +931,7 @@ void SendPeerThemeChangeRequest(
|
||||
}).send();
|
||||
|
||||
api->request(MTPmessages_SetChatTheme(
|
||||
peer->input,
|
||||
peer->input(),
|
||||
(unique
|
||||
? MTP_inputChatThemeUniqueGift(MTP_string(unique->slug))
|
||||
: MTP_inputChatTheme(MTP_string(token)))
|
||||
|
||||
@@ -228,7 +228,7 @@ void TranslateBox(
|
||||
translated->hide(anim::type::instant);
|
||||
state->api.request(MTPmessages_TranslateText(
|
||||
MTP_flags(flags),
|
||||
msgId ? peer->input : MTP_inputPeerEmpty(),
|
||||
msgId ? peer->input() : MTP_inputPeerEmpty(),
|
||||
(msgId
|
||||
? MTP_vector<MTPint>(1, MTP_int(msgId))
|
||||
: MTPVector<MTPint>()),
|
||||
|
||||
@@ -38,7 +38,7 @@ void UrlAuthBox::Activate(
|
||||
return;
|
||||
}
|
||||
const auto session = &message->history()->session();
|
||||
const auto inputPeer = message->history()->peer->input;
|
||||
const auto inputPeer = message->history()->peer->input();
|
||||
const auto buttonId = button->buttonId;
|
||||
const auto url = QString::fromUtf8(button->data);
|
||||
|
||||
@@ -127,7 +127,7 @@ void UrlAuthBox::Request(
|
||||
return;
|
||||
}
|
||||
const auto session = &message->history()->session();
|
||||
const auto inputPeer = message->history()->peer->input;
|
||||
const auto inputPeer = message->history()->peer->input();
|
||||
const auto buttonId = button->buttonId;
|
||||
const auto url = QString::fromUtf8(button->data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user