Update API scheme to layer 179.

This commit is contained in:
John Preston 2024-04-20 00:11:25 +04:00
parent 12a78c1f45
commit b3ae843f0e
6 changed files with 28 additions and 9 deletions

View File

@ -62,6 +62,10 @@ void ConfirmPhone::resolve(
return bad("FirebaseSms");
}, [&](const MTPDauth_sentCodeTypeEmailCode &) {
return bad("EmailCode");
}, [&](const MTPDauth_sentCodeTypeSmsWord &) {
return bad("SmsWord");
}, [&](const MTPDauth_sentCodeTypeSmsPhrase &) {
return bad("SmsPhrase");
}, [&](const MTPDauth_sentCodeTypeSetUpEmailRequired &) {
return bad("SetUpEmailRequired");
});

View File

@ -69,7 +69,7 @@ bool PollData::closeByTimer() {
bool PollData::applyChanges(const MTPDpoll &poll) {
Expects(poll.vid().v == id);
const auto newQuestion = qs(poll.vquestion());
const auto newQuestion = qs(poll.vquestion().data().vtext());
const auto newFlags = (poll.is_closed() ? Flag::Closed : Flag(0))
| (poll.is_public_voters() ? Flag::PublicVotes : Flag(0))
| (poll.is_multiple_choice() ? Flag::MultiChoice : Flag(0))
@ -82,7 +82,7 @@ bool PollData::applyChanges(const MTPDpoll &poll) {
return data.match([](const MTPDpollAnswer &answer) {
auto result = PollAnswer();
result.option = answer.voption().v;
result.text = qs(answer.vtext());
result.text = qs(answer.vtext().data().vtext());
return result;
});
}) | ranges::views::take(
@ -253,7 +253,9 @@ bool PollData::quiz() const {
MTPPoll PollDataToMTP(not_null<const PollData*> poll, bool close) {
const auto convert = [](const PollAnswer &answer) {
return MTP_pollAnswer(
MTP_string(answer.text),
MTP_textWithEntities(
MTP_string(answer.text),
MTP_vector<MTPMessageEntity>()),
MTP_bytes(answer.option));
};
auto answers = QVector<MTPPollAnswer>();
@ -272,7 +274,9 @@ MTPPoll PollDataToMTP(not_null<const PollData*> poll, bool close) {
return MTP_poll(
MTP_long(poll->id),
MTP_flags(flags),
MTP_string(poll->question),
MTP_textWithEntities(
MTP_string(poll->question),
MTP_vector<MTPMessageEntity>()),
MTP_vector<MTPPollAnswer>(answers),
MTP_int(poll->closePeriod),
MTP_int(poll->closeDate));

View File

@ -668,14 +668,14 @@ Poll ParsePoll(const MTPDmessageMediaPoll &data) {
auto result = Poll();
data.vpoll().match([&](const MTPDpoll &poll) {
result.id = poll.vid().v;
result.question = ParseString(poll.vquestion());
result.question = ParseString(poll.vquestion().data().vtext());
result.closed = poll.is_closed();
result.answers = ranges::views::all(
poll.vanswers().v
) | ranges::views::transform([](const MTPPollAnswer &answer) {
return answer.match([](const MTPDpollAnswer &answer) {
auto result = Poll::Answer();
result.text = ParseString(answer.vtext());
result.text = ParseString(answer.vtext().data().vtext());
result.option = answer.voption().v;
return result;
});

View File

@ -369,6 +369,10 @@ void Step::fillSentCodeData(const MTPDauth_sentCode &data) {
bad("FirebaseSms");
}, [&](const MTPDauth_sentCodeTypeEmailCode &) {
bad("EmailCode");
}, [&](const MTPDauth_sentCodeTypeSmsWord &) {
bad("SmsWord");
}, [&](const MTPDauth_sentCodeTypeSmsPhrase &) {
bad("SmsPhrase");
}, [&](const MTPDauth_sentCodeTypeSetUpEmailRequired &) {
bad("SetUpEmailRequired");
});

View File

@ -758,6 +758,8 @@ auth.sentCodeTypeEmailCode#f450f59b flags:# apple_signin_allowed:flags.0?true go
auth.sentCodeTypeSetUpEmailRequired#a5491dea flags:# apple_signin_allowed:flags.0?true google_signin_allowed:flags.1?true = auth.SentCodeType;
auth.sentCodeTypeFragmentSms#d9565c39 url:string length:int = auth.SentCodeType;
auth.sentCodeTypeFirebaseSms#e57b1432 flags:# nonce:flags.0?bytes receipt:flags.1?string push_timeout:flags.1?int length:int = auth.SentCodeType;
auth.sentCodeTypeSmsWord#a416ac81 flags:# beginning:flags.0?string = auth.SentCodeType;
auth.sentCodeTypeSmsPhrase#b37794af flags:# beginning:flags.0?string = auth.SentCodeType;
messages.botCallbackAnswer#36585ea4 flags:# alert:flags.1?true has_url:flags.3?true native_ui:flags.4?true message:flags.0?string url:flags.2?string cache_time:int = messages.BotCallbackAnswer;
@ -1149,9 +1151,9 @@ help.supportName#8c05f1c9 name:string = help.SupportName;
help.userInfoEmpty#f3ae2eed = help.UserInfo;
help.userInfo#1eb3758 message:string entities:Vector<MessageEntity> author:string date:int = help.UserInfo;
pollAnswer#6ca9c2e9 text:string option:bytes = PollAnswer;
pollAnswer#ff16e2ca text:TextWithEntities option:bytes = PollAnswer;
poll#86e18161 id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true question:string answers:Vector<PollAnswer> close_period:flags.4?int close_date:flags.5?int = Poll;
poll#58747131 id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true question:TextWithEntities answers:Vector<PollAnswer> close_period:flags.4?int close_date:flags.5?int = Poll;
pollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters;
@ -1808,6 +1810,7 @@ auth.checkRecoveryPassword#d36bf79 code:string = Bool;
auth.importWebTokenAuthorization#2db873a9 api_id:int api_hash:string web_auth_token:string = auth.Authorization;
auth.requestFirebaseSms#89464b50 flags:# phone_number:string phone_code_hash:string safety_net_token:flags.0?string ios_push_secret:flags.1?string = Bool;
auth.resetLoginEmail#7e960193 phone_number:string phone_code_hash:string = auth.SentCode;
auth.reportMissingCode#cb9deff6 phone_number:string phone_code_hash:string mnc:string = Bool;
account.registerDevice#ec86017a flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector<long> = Bool;
account.unregisterDevice#6a0d3206 token_type:int token:string other_uids:Vector<long> = Bool;
@ -2424,4 +2427,4 @@ smsjobs.finishJob#4f1ebf24 flags:# job_id:string error:flags.0?string = Bool;
fragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo;
// LAYER 178
// LAYER 179

View File

@ -2217,6 +2217,10 @@ void FormController::startPhoneVerification(not_null<Value*> value) {
bad("FirebaseSms");
}, [&](const MTPDauth_sentCodeTypeEmailCode &) {
bad("EmailCode");
}, [&](const MTPDauth_sentCodeTypeSmsWord &) {
bad("SmsWord");
}, [&](const MTPDauth_sentCodeTypeSmsPhrase &) {
bad("SmsPhrase");
}, [&](const MTPDauth_sentCodeTypeSetUpEmailRequired &) {
bad("SetUpEmailRequired");
});