Update API scheme.

This commit is contained in:
John Preston 2019-08-01 10:22:49 +01:00
parent 052e4bc508
commit abf49e1672
11 changed files with 21 additions and 18 deletions

View File

@ -312,8 +312,6 @@ photoStrippedSize#e0b0bc2e type:string bytes:bytes = PhotoSize;
geoPointEmpty#1117dd5f = GeoPoint;
geoPoint#296f104 long:double lat:double access_hash:long = GeoPoint;
auth.checkedPhone#811ea28e phone_registered:Bool = auth.CheckedPhone;
auth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode;
auth.authorization#cd050916 flags:# tmp_sessions:flags.0?int user:User = auth.Authorization;
@ -637,6 +635,7 @@ chatInvite#dfc2f58e flags:# channel:flags.0?true broadcast:flags.1?true public:f
inputStickerSetEmpty#ffb62b95 = InputStickerSet;
inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;
inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;
inputStickerSetAnimatedEmoji#28703c8 = InputStickerSet;
stickerSet#eeb46f27 flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumb:flags.4?PhotoSize thumb_dc_id:flags.4?int count:int hash:int = StickerSet;
@ -1145,7 +1144,7 @@ inputWallPaperSlug#72091c80 slug:string = InputWallPaper;
account.wallPapersNotModified#1c199183 = account.WallPapers;
account.wallPapers#702b65a9 hash:int wallpapers:Vector<WallPaper> = account.WallPapers;
codeSettings#302f59f3 flags:# allow_flashcall:flags.0?true current_number:flags.1?true app_hash_persistent:flags.2?true app_hash:flags.3?string = CodeSettings;
codeSettings#debebe83 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true = CodeSettings;
wallPaperSettings#a12f40b8 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int intensity:flags.3?int = WallPaperSettings;
@ -1411,7 +1410,7 @@ photos.deletePhotos#87cf7f2f id:Vector<InputPhoto> = Vector<long>;
photos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int = photos.Photos;
upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File;
upload.getFile#b15a9afc flags:# precise:flags.0?true location:InputFileLocation offset:int limit:int = upload.File;
upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
upload.getWebFile#24e6818d location:InputWebFileLocation offset:int limit:int = upload.WebFile;
upload.getCdnFile#2000bcc3 file_token:bytes offset:int limit:int = upload.CdnFile;

View File

@ -163,9 +163,7 @@ void ChangePhoneBox::EnterPhone::submit() {
_requestId = MTP::send(
MTPaccount_SendChangePhoneCode(
MTP_string(phoneNumber),
MTP_codeSettings(
MTP_flags(0),
MTPstring())),
MTP_codeSettings(MTP_flags(0))),
rpcDone(crl::guard(this, [=](
const MTPauth_SentCode &result) {
return sendPhoneDone(phoneNumber, result);

View File

@ -219,9 +219,7 @@ void ConfirmPhoneBox::checkPhoneAndHash() {
_sendCodeRequestId = MTP::send(
MTPaccount_SendConfirmPhoneCode(
MTP_string(_hash),
MTP_codeSettings(
MTP_flags(0),
MTPstring())),
MTP_codeSettings(MTP_flags(0))),
rpcDone(&ConfirmPhoneBox::sendCodeDone),
rpcFail(&ConfirmPhoneBox::sendCodeFail));
}

View File

@ -223,6 +223,7 @@ StickerSetBox::Inner::Inner(
}, [&](const MTPDinputStickerSetShortName &data) {
_setShortName = qs(data.vshort_name());
}, [&](const MTPDinputStickerSetEmpty &) {
}, [&](const MTPDinputStickerSetAnimatedEmoji &) {
});
_mtp.request(MTPmessages_GetStickerSet(

View File

@ -1134,6 +1134,8 @@ bool DocumentData::isStickerSetInstalled() const {
return false;
}, [&](const MTPDinputStickerSetEmpty &) {
return false;
}, [&](const MTPDinputStickerSetAnimatedEmoji &) {
return false;
});
}

View File

@ -380,6 +380,7 @@ auto ApiWrap::fileRequest(const Data::FileLocation &location, int offset) {
return std::move(_mtp.request(MTPInvokeWithTakeout<MTPupload_GetFile>(
MTP_long(*_takeoutId),
MTPupload_GetFile(
MTP_flags(0),
location.data,
MTP_int(offset),
MTP_int(kFileChunkSize))

View File

@ -122,9 +122,7 @@ void PhoneWidget::submit() {
MTP_string(_sentPhone),
MTP_int(ApiId),
MTP_string(ApiHash),
MTP_codeSettings(
MTP_flags(0),
MTPstring())),
MTP_codeSettings(MTP_flags(0))),
rpcDone(&PhoneWidget::phoneSubmitDone),
rpcFail(&PhoneWidget::phoneSubmitFail));
}

View File

@ -309,7 +309,11 @@ void DedicatedLoader::sendRequest() {
const auto offset = _offset;
_requests.push_back({ offset });
_mtp.send(
MTPupload_GetFile(_location, MTP_int(offset), MTP_int(kChunkSize)),
MTPupload_GetFile(
MTP_flags(0),
_location,
MTP_int(offset),
MTP_int(kChunkSize)),
[=](const MTPupload_File &result) { gotPart(offset, result); },
failHandler(),
MTP::updaterDcId(_dcId));

View File

@ -2084,9 +2084,7 @@ QString FormController::getPlainTextFromValue(
void FormController::startPhoneVerification(not_null<Value*> value) {
value->verification.requestId = request(MTPaccount_SendVerifyPhoneCode(
MTP_string(getPhoneFromValue(value)),
MTP_codeSettings(
MTP_flags(0),
MTPstring())
MTP_codeSettings(MTP_flags(0))
)).done([=](const MTPauth_SentCode &result) {
Expects(result.type() == mtpc_auth_sentCode);

View File

@ -782,6 +782,7 @@ mtpRequestId mtpFileLoader::sendRequest(const RequestData &requestData) {
}, [&](const StorageFileLocation &location) {
return MTP::send(
MTPupload_GetFile(
MTP_flags(0),
location.tl(session().userId()),
MTP_int(offset),
MTP_int(limit)),

View File

@ -157,7 +157,10 @@ StorageFileLocation::StorageFileLocation(
_id = data.vid().v;
_accessHash = data.vaccess_hash().v;
}, [&](const MTPDinputStickerSetShortName &data) {
Unexpected("inputStickerSetShortName in StorageFileLocation().");
Unexpected("inputStickerSetShortName in StorageFileLocation.");
}, [&](const MTPDinputStickerSetAnimatedEmoji &data) {
Unexpected(
"inputStickerSetAnimatedEmoji in StorageFileLocation.");
});
_volumeId = data.vvolume_id().v;
_localId = data.vlocal_id().v;