From 4052bffcd500cc7b7e365fa35d5f1468a21cd65b Mon Sep 17 00:00:00 2001 From: levlam Date: Sat, 11 Aug 2018 00:08:13 +0300 Subject: [PATCH] Update layer 85. GitOrigin-RevId: 5902d95080c65b2aed40d199f14634dadb30926a --- td/generate/scheme/td_api.tl | 28 +++++++++++----------- td/generate/scheme/td_api.tlo | Bin 132100 -> 132104 bytes td/generate/scheme/telegram_api.tl | 4 ++-- td/generate/scheme/telegram_api.tlo | Bin 164268 -> 164276 bytes td/telegram/SecureManager.cpp | 24 +++++++++---------- td/telegram/SecureValue.cpp | 6 ++--- td/telegram/files/FileGenerateManager.cpp | 2 +- 7 files changed, 32 insertions(+), 32 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 21398acb..6818dc38 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -878,12 +878,12 @@ date day:int32 month:int32 year:int32 = Date; personalDetails first_name:string middle_name:string last_name:string birthdate:date gender:string country_code:string residence_country_code:string = PersonalDetails; //@description An identity document @number Document number; 1-24 characters @expiry_date Document expiry date; may be null @front_side Front side of the document -//@reverse_side Reverse side of the document; only for driver license and identity card @selfie Selfie with the document; may be null @translations List of files with the document translation -identityDocument number:string expiry_date:date front_side:datedFile reverse_side:datedFile selfie:datedFile translations:vector = IdentityDocument; +//@reverse_side Reverse side of the document; only for driver license and identity card @selfie Selfie with the document; may be null @translation List of files with the document translation +identityDocument number:string expiry_date:date front_side:datedFile reverse_side:datedFile selfie:datedFile translation:vector = IdentityDocument; //@description An identity document to be saved @number Document number; 1-24 characters @expiry_date Document expiry date, if available @front_side Front side of the document -//@reverse_side Reverse side of the document; only for driver license and identity card @selfie Selfie with the document, if available @translations List of files with the document translation -inputIdentityDocument number:string expiry_date:date front_side:InputFile reverse_side:InputFile selfie:InputFile translations:vector = InputIdentityDocument; +//@reverse_side Reverse side of the document; only for driver license and identity card @selfie Selfie with the document, if available @translation List of files with the document translation +inputIdentityDocument number:string expiry_date:date front_side:InputFile reverse_side:InputFile selfie:InputFile translation:vector = InputIdentityDocument; //@class PassportElement @description Contains information about a Telegram Passport element @@ -991,11 +991,11 @@ passportElementErrorSourceReverseSide = PassportElementErrorSource; //@description The selfie with the document contains an error. The error will be considered resolved when the file with the selfie changes passportElementErrorSourceSelfie = PassportElementErrorSource; -//@description The translation of the document contains an error. The error will be considered resolved when the file with the translation changes -passportElementErrorSourceTranslation = PassportElementErrorSource; +//@description One of files with the translation of the document contains an error. The error will be considered resolved when the file changes +passportElementErrorSourceTranslationFile = PassportElementErrorSource; -//@description The list of translations of the document contains an error. The error will be considered resolved when the list of translations changes -passportElementErrorSourceTranslations = PassportElementErrorSource; +//@description The translation of the document contains an error. The error will be considered resolved when the list of translation files changes +passportElementErrorSourceTranslationFiles = PassportElementErrorSource; //@description The file contains an error. The error will be considered resolved when the file changes passportElementErrorSourceFile = PassportElementErrorSource; @@ -1019,8 +1019,8 @@ passportAuthorizationForm id:int32 required_types:vector el encryptedCredentials data:bytes hash:bytes secret:bytes = EncryptedCredentials; -//@description Contains information about encrypted Telegram Passport element; for bots only @type Type of Telegram Passport element @data Encrypted JSON-encoded data about the user @front_side The front side of an identity document @reverse_side The reverse side of an identity document; may be null @selfie Selfie with the document; may be null @translations List of files with the document translation @files List of attached files @value Unencrypted data, phone number or email address @hash Hash of the whole element -encryptedPassportElement type:PassportElementType data:bytes front_side:datedFile reverse_side:datedFile selfie:datedFile translations:vector files:vector value:string hash:string = EncryptedPassportElement; +//@description Contains information about encrypted Telegram Passport element; for bots only @type Type of Telegram Passport element @data Encrypted JSON-encoded data about the user @front_side The front side of an identity document @reverse_side The reverse side of an identity document; may be null @selfie Selfie with the document; may be null @translation List of files with the document translation @files List of attached files @value Unencrypted data, phone number or email address @hash Hash of the whole element +encryptedPassportElement type:PassportElementType data:bytes front_side:datedFile reverse_side:datedFile selfie:datedFile translation:vector files:vector value:string hash:string = EncryptedPassportElement; //@class InputPassportElementErrorSource @description Contains the description of an error in Telegram Passport element; for bots only @@ -1040,11 +1040,11 @@ inputPassportElementErrorSourceReverseSide file_hash:bytes = InputPassportElemen //@description The selfie contains an error. The error is considered resolved when the file with the selfie changes @file_hash Current hash of the file containing the selfie inputPassportElementErrorSourceSelfie file_hash:bytes = InputPassportElementErrorSource; -//@description The translation contains an error. The error is considered resolved when the file with the translation changes @file_hash Current hash of the file containing the translation -inputPassportElementErrorSourceTranslation file_hash:bytes = InputPassportElementErrorSource; +//@description One of files with the translation of the document contains an error. The error is considered resolved when the file with the translation changes @file_hash Current hash of the file containing the translation +inputPassportElementErrorSourceTranslationFile file_hash:bytes = InputPassportElementErrorSource; -//@description The list of translation files contains an error. The error is considered resolved when the file list changes @file_hashes Current hashes of all files with the translation -inputPassportElementErrorSourceTranslations file_hashes:vector = InputPassportElementErrorSource; +//@description The translation of the document contains an error. The error is considered resolved when the file list changes @file_hashes Current hashes of all files with the translation +inputPassportElementErrorSourceTranslationFiles file_hashes:vector = InputPassportElementErrorSource; //@description The file contains an error. The error is considered resolved when the file changes @file_hash Current hash of the file with an error inputPassportElementErrorSourceFile file_hash:bytes = InputPassportElementErrorSource; diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index 6d2b20796799b30ade4de607aa97c971bc3e8d12..1576b0a0d8471f23cd90e11645d059494a29ec83 100644 GIT binary patch delta 904 zcmZqa;OOY!*sy|=MeuKA`Q|m83m93>Y@Q;uIe@!?k;Sp!?&abuJdCXO#qQ3QpS+M) za`L`4Y@2`Z-eG06DVVfgYVti^sm-5-=Z3I>v`eH;UdJiL31Z$nCgj68*-=e=@`a2! zJlrKkiFw62i6xo&d6PF}>P}vnSq`yKC2IqR49G%(%#_r;lFX7ym;B_?Tp*KyfdM2w z`9skjRQ(F?4IobZP<(`60pvu{%)Elq5>E^RKypC+DU&T)B2dj(&|(1g+~zASTNJ>o z$qGvqCa+l<0Om|uR)7$kvMd6k_QSFg78X!QOwL#x0AcJ|Z2@8YSZxDgSgeVFFs7`5 ziX2#L0ukX^i!Rc#7OEYnMigW+(9>XWRgNpBx=T$?Z*t>0El#)0oKyy|#n{w6*gNTg zK3rWfSlxzo9uPbKtb3VP=Uk-$CU{Z;IN(S@Lpl^o;N-Sj?P;T z1ZT$E061qe&pQnk7Eo%KZ1KrQ0>l7CKFAwI&TKjywrvN&l5;+paKa=RC)=)3pZr0K z1EP=Tvk7i}5uYt^ORo5Aq6IS)-9~Ug0trx9s!p1BQ?p<)|2h=|a9}bJqe*7TQY9_0 fCOMF%Vw{>LPx)ei+l_bdNH(i{-LCSL@c|zI*@tc1 delta 878 zcmeC^;ArXK*sy|=C7yAU|K>HE3m93XO0}If2XHqqvRs}JG;Q$}9!6ICUmBV6lNa(z zZvMpkh?RA>e(7$h$@h4rHh&hL8^Q+CDv>&Q9j6p0hb+H35rET8kzyxneC; zH&BTP$Y7vP!QiSKSIoULNgpORtX7zu|Am{C0cjb7l`u7%Kdcu}0mr~}jmL}%n^mq9NPq)$@_}~>lXtxFL2xwQ zdLTGc-Uh%qn>pTTu&{uV!eoQ_YGo2v#=FI9|F{p1;63~;;b R0UpU_jj!7^zA`@G0|4;dP;dYM diff --git a/td/generate/scheme/telegram_api.tl b/td/generate/scheme/telegram_api.tl index 2459c306..21f317d5 100644 --- a/td/generate/scheme/telegram_api.tl +++ b/td/generate/scheme/telegram_api.tl @@ -886,8 +886,8 @@ secureValueErrorSelfie#e537ced6 type:SecureValueType file_hash:bytes text:string secureValueErrorFile#7a700873 type:SecureValueType file_hash:bytes text:string = SecureValueError; secureValueErrorFiles#666220e9 type:SecureValueType file_hash:Vector text:string = SecureValueError; secureValueError#869d758f type:SecureValueType hash:bytes text:string = SecureValueError; -secureValueErrorTranslation#5fbc1134 type:SecureValueType file_hash:bytes text:string = SecureValueError; -secureValueErrorTranslations#781e629b type:SecureValueType file_hash:Vector text:string = SecureValueError; +secureValueErrorTranslationFile#a1144770 type:SecureValueType file_hash:bytes text:string = SecureValueError; +secureValueErrorTranslationFiles#34636dd8 type:SecureValueType file_hash:Vector text:string = SecureValueError; secureCredentialsEncrypted#33f0ea47 data:bytes hash:bytes secret:bytes = SecureCredentialsEncrypted; diff --git a/td/generate/scheme/telegram_api.tlo b/td/generate/scheme/telegram_api.tlo index ba76627ed085113a63b72eb9bed8aa7dcc6b54db..e3d39df97ff9c525199209213a59e3764673a8da 100644 GIT binary patch delta 303 zcmZ3}%(bPNYeR|z%iE>#EzKDc+cP8>&xmt^csGv;`LIk6G-A}4o@&6D4puS!f&rrr zm^ICiu>>MiVTd850Mvx0>IkM#hA~2w!}J@bj2;jJ6-*daV7hgt`#3TROn;ybBmxW> zRYXB9V}OFIa$GS5?jj52r=K-pl;&{D%t-}FgPew;?nZ91i2_(14@g}x&&xmt^csGv;`LIk6G-A}4o@&6D4puS!f&rrr zm^ICiu>>MiVTd850Mvx0>IkM#hA~vt^aZAj9T3A5Oc+&QI(4Skm@&#spJ2kMAqsL3 z0~B19(); break; } - case telegram_api::secureValueErrorTranslation::ID: { - auto error = move_tl_object_as(error_ptr); + case telegram_api::secureValueErrorTranslationFile::ID: { + auto error = move_tl_object_as(error_ptr); type = get_secure_value_type(error->type_); message = std::move(error->text_); - source = td_api::make_object(); + source = td_api::make_object(); break; } - case telegram_api::secureValueErrorTranslations::ID: { - auto error = move_tl_object_as(error_ptr); + case telegram_api::secureValueErrorTranslationFiles::ID: { + auto error = move_tl_object_as(error_ptr); type = get_secure_value_type(error->type_); message = std::move(error->text_); - source = td_api::make_object(); + source = td_api::make_object(); break; } default: @@ -949,19 +949,19 @@ void SecureManager::set_secure_value_errors(Td *td, tl_object_ptrfile_hash_), error->message_)); break; } - case td_api::inputPassportElementErrorSourceTranslation::ID: { - auto source = td_api::move_object_as(error->source_); - input_errors.push_back(make_tl_object( + case td_api::inputPassportElementErrorSourceTranslationFile::ID: { + auto source = td_api::move_object_as(error->source_); + input_errors.push_back(make_tl_object( std::move(type), BufferSlice(source->file_hash_), error->message_)); break; } - case td_api::inputPassportElementErrorSourceTranslations::ID: { - auto source = td_api::move_object_as(error->source_); + case td_api::inputPassportElementErrorSourceTranslationFiles::ID: { + auto source = td_api::move_object_as(error->source_); if (source->file_hashes_.empty()) { return promise.set_error(Status::Error(400, "File hashes must be non-empty")); } auto file_hashes = transform(source->file_hashes_, [](Slice hash) { return BufferSlice(hash); }); - input_errors.push_back(make_tl_object( + input_errors.push_back(make_tl_object( std::move(type), std::move(file_hashes), error->message_)); break; } diff --git a/td/telegram/SecureValue.cpp b/td/telegram/SecureValue.cpp index 30eabe55..4681c706 100644 --- a/td/telegram/SecureValue.cpp +++ b/td/telegram/SecureValue.cpp @@ -874,8 +874,8 @@ static Result get_identity_document(SecureValueType type, FileManag TRY_RESULT(selfie, get_secure_file(file_manager, std::move(identity_document->selfie_))); res.selfie = std::move(selfie); } - if (!identity_document->translations_.empty()) { - TRY_RESULT(translations, get_secure_files(file_manager, std::move(identity_document->translations_))); + if (!identity_document->translation_.empty()) { + TRY_RESULT(translations, get_secure_files(file_manager, std::move(identity_document->translation_))); res.translations = std::move(translations); } return res; @@ -1406,7 +1406,7 @@ static auto credentials_as_jsonable(const std::vector &c o("selfie", as_jsonable(cred.selfie.value())); } if (!cred.translations.empty() && with_translations) { - o("translations", as_jsonable(cred.translations)); + o("translation", as_jsonable(cred.translations)); } })); } diff --git a/td/telegram/files/FileGenerateManager.cpp b/td/telegram/files/FileGenerateManager.cpp index 22472a24..db32d575 100644 --- a/td/telegram/files/FileGenerateManager.cpp +++ b/td/telegram/files/FileGenerateManager.cpp @@ -222,7 +222,7 @@ void FileGenerateManager::generate_file(uint64 query_id, const FullGenerateFileL Slice conversion = generate_location.conversion_; auto &query = it_flag.first->second; - if (conversion.copy().truncate(file_id_query.size()) == file_id_query) { + if (begins_with(conversion, file_id_query)) { auto file_id = FileId(to_integer(conversion.substr(file_id_query.size())), 0); query.worker_ = create_actor("FileDownloadGenerateActor", generate_location.file_type_, file_id, std::move(callback), std::move(parent));