From 56a2cac6baca719766b859aa666835b8aa7372f2 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 1 Jun 2018 23:15:13 +0300 Subject: [PATCH] Update layer to 81. GitOrigin-RevId: c6579e02edaff656ab17b3d94695cab8c7960b2d --- td/generate/scheme/telegram_api.tl | 12 ++++-- td/generate/scheme/telegram_api.tlo | Bin 158236 -> 159348 bytes td/telegram/Td.cpp | 56 +--------------------------- td/telegram/net/MtprotoHeader.cpp | 2 +- 4 files changed, 11 insertions(+), 59 deletions(-) diff --git a/td/generate/scheme/telegram_api.tl b/td/generate/scheme/telegram_api.tl index a043b846..f551efd4 100644 --- a/td/generate/scheme/telegram_api.tl +++ b/td/generate/scheme/telegram_api.tl @@ -176,7 +176,7 @@ geoPoint#2049d70c long:double lat:double = GeoPoint; auth.checkedPhone#811ea28e phone_registered:Bool = auth.CheckedPhone; -auth.sentCode#5e002502 flags:# phone_registered:flags.0?true type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode; +auth.sentCode#38faab5f flags:# phone_registered:flags.0?true type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int terms_of_service:flags.3?help.TermsOfService = auth.SentCode; auth.authorization#cd050916 flags:# tmp_sessions:flags.0?int user:User = auth.Authorization; @@ -557,7 +557,7 @@ channels.channelParticipantsNotModified#f0173fe9 = channels.ChannelParticipants; channels.channelParticipant#d0d9b163 participant:ChannelParticipant users:Vector = channels.ChannelParticipant; -help.termsOfService#f1ee3e90 text:string = help.TermsOfService; +help.termsOfService#780a0310 flags:# popup:flags.0?true id:DataJSON text:string entities:Vector min_age_confirm:flags.1?int = help.TermsOfService; foundGif#162ecc1f url:string thumb_url:string content_url:string content_type:string w:int h:int = FoundGif; foundGifCached#9c750409 url:string photo:Photo document:Document = FoundGif; @@ -721,6 +721,8 @@ webDocumentNoProxy#f9c8bcc6 url:string size:int mime_type:string attributes:Vect inputWebDocument#9bed434d url:string size:int mime_type:string attributes:Vector = InputWebDocument; inputWebFileLocation#c239d686 url:string access_hash:long = InputWebFileLocation; +inputWebFileGeoPointLocation#66275a62 geo_point:InputGeoPoint w:int h:int zoom:int scale:int = InputWebFileLocation; +inputWebFileGeoMessageLocation#553f32eb peer:InputPeer msg_id:int w:int h:int zoom:int scale:int = InputWebFileLocation; upload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile; @@ -840,6 +842,9 @@ inputClientProxy#75588b3f address:string port:int = InputClientProxy; help.proxyDataEmpty#e09e1fb8 expires:int = help.ProxyData; help.proxyDataPromo#2bf7ee23 expires:int peer:Peer chats:Vector users:Vector = help.ProxyData; +help.termsOfServiceUpdateEmpty#e3309f7f expires:int = help.TermsOfServiceUpdate; +help.termsOfServiceUpdate#28ecf961 expires:int terms_of_service:help.TermsOfService = help.TermsOfServiceUpdate; + inputSecureFileUploaded#3334b0f0 id:long parts:int md5_checksum:string file_hash:bytes secret:bytes = InputSecureFile; inputSecureFile#5367e5be id:long access_hash:long = InputSecureFile; @@ -1095,11 +1100,12 @@ help.saveAppLog#6f02f748 events:Vector = Bool; help.getInviteText#4d392343 = help.InviteText; help.getSupport#9cdf08cd = help.Support; help.getAppChangelog#9010ef6f prev_app_version:string = Updates; -help.getTermsOfService#8e59b7e7 country_iso2:string = help.TermsOfService; help.setBotUpdatesStatus#ec22cfcd pending_updates_count:int message:string = Bool; help.getCdnConfig#52029342 = CdnConfig; help.getRecentMeUrls#3dc0f114 referer:string = help.RecentMeUrls; help.getProxyData#3d7758e1 = help.ProxyData; +help.getTermsOfServiceUpdate#2ca51fd1 = help.TermsOfServiceUpdate; +help.acceptTermsOfService#ee72f79a id:DataJSON = Bool; help.getDeepLinkInfo#3fedc75f path:string = help.DeepLinkInfo; channels.readHistory#cc104937 channel:InputChannel max_id:int = Bool; diff --git a/td/generate/scheme/telegram_api.tlo b/td/generate/scheme/telegram_api.tlo index 11ff42665cba78089c2cc3930d33625f7504a387..6d211a8037832d5bbeb743d3a9230284e84ce27a 100644 GIT binary patch delta 948 zcmZ{jZ%7ki7{K?OciMDw(-};>W+TZ7VpIGuLg|B)AF>+M3PPIa`A!eE-P)aEK}2BX zm!N#1*UU(Y@Iyk#p!*^+AtG>)LBS*;u~0|}gXr&<_TG7-Y4_>nx##&k@AG@^M&DY$ zEm-YK_YWPmY&@%z_CLj}W7_)_+Z=9OW^<>S9G{BW@YCOcRF!8qk9Fo1_T#j-mh(gw zX3O!6*TsbrU4n}56jh|wyb}e0Q}=4dhja*8+zUR;KkzkEq}k-1r?9>Ae07AE;)!1M z9O^tKMNun~gR&G?+hkEtB{`l;rZw{~OWQbnajY7zKW0hB0RfJ^EXy(My~4AKC`9q( z^~xRe)rKP>&p-4NNKu4tw8=N=`9vsXYDn=}#)H?DM!a}@mk#- z)(W)haV@(7FZg{UKayXJc?D5K3H1!!vAHF3?KQZ_Vm)Ic{hy&q8)cbSOw*gnC$+q; js2gq1M~3U11XDEiv2FNt0W)yH_>G*132MU;W+3k`R%28N delta 365 zcmexzhjY#qPTohe^{p77;MGRn-+U}>*DMcB=HZu^{De_rvkm_fJ{BfbhPcftax<7& zCfL3EIQf90&Sn**HSCQ2n=fiEp9IlRvnK$|*t}(*#AykT4&KDlk_^4#)Vvbs{FGD% z29Vg~25*DuB3+DUCNJ>h0GqpAp_|b_kQHRG@bt#HjKUB*CLA>YGqz{UV`MR6WZj;7 zfpIxESjXfEdIr;FUNg2#4zPxpG5y9JMgxSL&0WS8FmL*iyNnYM;wXByOWbE+|iAePYueax;l>F@T(X^O%qi e promise_; - - public: - explicit GetTermsOfServiceQuery(Promise &&promise) : promise_(std::move(promise)) { - } - - void send(const string &country_code) { - send_query(G()->net_query_creator().create(create_storer(telegram_api::help_getTermsOfService(country_code)), - DcId::main(), NetQuery::Type::Common, NetQuery::AuthFlag::Off)); - } - - void on_result(uint64 id, BufferSlice packet) override { - auto result_ptr = fetch_result(packet); - if (result_ptr.is_error()) { - return on_error(id, result_ptr.move_as_error()); - } - - promise_.set_value(std::move(result_ptr.ok()->text_)); - } - - void on_error(uint64 id, Status status) override { - promise_.set_error(std::move(status)); - } -}; - class GetDeepLinkInfoQuery : public Td::ResultHandler { Promise> promise_; @@ -3837,34 +3811,6 @@ class GetInviteTextRequest : public RequestActor { } }; -class GetTermsOfServiceRequest : public RequestActor { - string country_code_; - - string text_; - - void do_run(Promise &&promise) override { - if (get_tries() < 2) { - promise.set_value(std::move(text_)); - return; - } - - td->create_handler(std::move(promise))->send(country_code_); - } - - void do_set_result(string &&result) override { - text_ = std::move(result); - } - - void do_send_result() override { - send_result(make_tl_object(text_)); - } - - public: - GetTermsOfServiceRequest(ActorShared td, uint64 request_id, string country_code) - : RequestActor(std::move(td), request_id), country_code_(country_code) { - } -}; - /** Td **/ Td::Td(std::unique_ptr callback) : callback_(std::move(callback)) { } @@ -7011,7 +6957,7 @@ void Td::on_request(uint64 id, const td_api::getInviteText &request) { void Td::on_request(uint64 id, td_api::getTermsOfService &request) { CLEAN_INPUT_STRING(request.country_code_); - CREATE_REQUEST(GetTermsOfServiceRequest, std::move(request.country_code_)); + send_error_raw(id, 500, "Unsupported"); } void Td::on_request(uint64 id, td_api::getDeepLinkInfo &request) { diff --git a/td/telegram/net/MtprotoHeader.cpp b/td/telegram/net/MtprotoHeader.cpp index 83d33b44..7cf5a484 100644 --- a/td/telegram/net/MtprotoHeader.cpp +++ b/td/telegram/net/MtprotoHeader.cpp @@ -18,7 +18,7 @@ class HeaderStorer { } template void store(StorerT &storer) const { - constexpr int32 LAYER = 80; + constexpr int32 LAYER = 81; using td::store; // invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;