mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Full support and build fix.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user