From 3d8ff7f85224dac8087adf590beacf9aa40b2201 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 29 May 2020 11:26:08 +0300 Subject: [PATCH] Update layer to 114. GitOrigin-RevId: 8cfc80aa94c507de56d068472e152fb8aa0ab8a9 --- td/generate/scheme/telegram_api.tl | 13 +++++-------- td/generate/scheme/telegram_api.tlo | Bin 206868 -> 206580 bytes td/telegram/CallActor.cpp | 8 ++++++-- td/telegram/CallActor.h | 1 + td/telegram/CallId.h | 2 +- td/telegram/CallManager.cpp | 18 ++++++++++++++++-- td/telegram/CallManager.h | 1 + td/telegram/MessageContent.cpp | 2 +- td/telegram/UpdatesManager.cpp | 5 +++++ td/telegram/UpdatesManager.h | 1 + td/telegram/Version.h | 2 +- 11 files changed, 38 insertions(+), 15 deletions(-) diff --git a/td/generate/scheme/telegram_api.tl b/td/generate/scheme/telegram_api.tl index 09381d698..d0b47b8b8 100644 --- a/td/generate/scheme/telegram_api.tl +++ b/td/generate/scheme/telegram_api.tl @@ -52,7 +52,6 @@ inputMediaContact#f8ab7dfb phone_number:string first_name:string last_name:strin inputMediaUploadedDocument#5b38c6c1 flags:# nosound_video:flags.3?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector stickers:flags.0?Vector ttl_seconds:flags.1?int = InputMedia; inputMediaDocument#23ab23d2 flags:# id:InputDocument ttl_seconds:flags.0?int = InputMedia; inputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string = InputMedia; -inputMediaGifExternal#4843b0fd url:string q:string = InputMedia; inputMediaPhotoExternal#e5bbfe1a flags:# url:string ttl_seconds:flags.0?int = InputMedia; inputMediaDocumentExternal#fb52dc99 flags:# url:string ttl_seconds:flags.0?int = InputMedia; inputMediaGame#d33f43f3 id:InputGame = InputMedia; @@ -344,6 +343,7 @@ updateMessagePollVote#42f88f2c poll_id:long user_id:int options:Vector = updateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update; updateDialogFilterOrder#a5d72105 order:Vector = Update; updateDialogFilters#3504914f = Update; +updatePhoneCallSignalingData#2661bf09 phone_call_id:long data:bytes = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -408,7 +408,7 @@ inputDocumentEmpty#72f0eaae = InputDocument; inputDocument#1abfb575 id:long access_hash:long file_reference:bytes = InputDocument; documentEmpty#36f8c871 id:long = Document; -document#9ba29cc1 flags:# id:long access_hash:long file_reference:bytes date:int mime_type:string size:int thumbs:flags.0?Vector dc_id:int attributes:Vector = Document; +document#1e87342b flags:# id:long access_hash:long file_reference:bytes date:int mime_type:string size:int thumbs:flags.0?Vector video_thumbs:flags.1?Vector dc_id:int attributes:Vector = Document; help.support#17c6b5f6 phone_number:string user:User = help.Support; @@ -605,11 +605,6 @@ channels.channelParticipant#d0d9b163 participant:ChannelParticipant users:Vector 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; - -messages.foundGifs#450a1c0a next_offset:int results:Vector = messages.FoundGifs; - messages.savedGifsNotModified#e8025ca2 = messages.SavedGifs; messages.savedGifs#2e0709a5 hash:int gifs:Vector = messages.SavedGifs; @@ -1127,6 +1122,8 @@ stats.broadcastStats#bdf78394 period:StatsDateRangeDays followers:StatsAbsValueA help.promoDataEmpty#98f6ac75 expires:int = help.PromoData; help.promoData#8c39793f flags:# proxy:flags.0?true expires:int peer:Peer chats:Vector users:Vector psa_type:flags.1?string psa_message:flags.2?string = help.PromoData; +videoSize#435bb987 type:string location:FileLocation w:int h:int size:int = VideoSize; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -1296,7 +1293,6 @@ messages.migrateChat#15a3b8e3 chat_id:int = Updates; messages.searchGlobal#bf7225a4 flags:# folder_id:flags.0?int q:string offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages; messages.reorderStickerSets#78337739 flags:# masks:flags.0?true order:Vector = Bool; messages.getDocumentByHash#338e2464 sha256:bytes size:int mime_type:string = Document; -messages.searchGifs#bf9a776b q:string offset:int = messages.FoundGifs; messages.getSavedGifs#83bf3d52 hash:int = messages.SavedGifs; messages.saveGif#327a30cb id:InputDocument unsave:Bool = Bool; messages.getInlineBotResults#514e999d flags:# bot:InputUser peer:InputPeer geo_point:flags.0?InputGeoPoint query:string offset:string = messages.BotResults; @@ -1472,6 +1468,7 @@ phone.receivedCall#17d54f61 peer:InputPhoneCall = Bool; phone.discardCall#b2cbc1c0 flags:# video:flags.0?true peer:InputPhoneCall duration:int reason:PhoneCallDiscardReason connection_id:long = Updates; phone.setCallRating#59ead627 flags:# user_initiative:flags.0?true peer:InputPhoneCall rating:int comment:string = Updates; phone.saveCallDebug#277add7e peer:InputPhoneCall debug:DataJSON = Bool; +phone.sendSignalingData#ff7a9383 peer:InputPhoneCall data:bytes = Bool; langpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference; langpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector = Vector; diff --git a/td/generate/scheme/telegram_api.tlo b/td/generate/scheme/telegram_api.tlo index d6fdd39b2e9a3838800a4efabcc9556de9fa0711..a15fad90f0809124f20cd879c5e469858f9fb9ef 100644 GIT binary patch delta 3259 zcmaJ@eQaCR709-zj(^9KNi!8HSSKb%- zrL<4fZAQfOgE^X0JAURFN;QLW|b@(9C0|Pwe}t6VJzO zIIKx-Q-FsxyLMUgdjFoaQe;Ql&h61ImEs1UC=VhZ4o=vpR>@}jmEo~PZQr^5XGDGo zd8|epxbSv6%P8aiLGQ67ek z_|oWG<_RlfE=JfV0=O_1WCusy&4@tW&j?i@iF}eF!EvuiXv(+>47z-gtJx>I84{o1 z=KH?)VOM$p2OpIf$3Ds8!O3TRxN|bZ(Cj2LdOg}X#jV7rI6F7RJdxycG@I=$>#+TR zm*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yi!=?BqDqFy9>Hvbz_doNqcdlx1R~r-ybhZyM~Zy;wWT%N=V}F@-J_#LScqV~eDG zlguK+VC5k@hmmt~80%7b85}kou3esMwUNnJNEP>rMUllv3%2g;6?QQ%mhF@{ET*E`*DS{Gq_!@l0cdANa z&RSH3rCW(O)pJQ4RedDo6gIXh1+K@Z+?4|7Q**^DI0EG%gfA!s0!6Tbgo-a!83{6LR`P7<`c+s5pibRklKm!aEH$HN-Ij( zKhkiBN$4*E=a8E4|w5c{s^6{O#3ln zsoFBRUiJMQs>Ij6`yt5c+ydD1`9omoztGK9s-{w&^8=qY5O5FO_KR>&+DG(0T9I3Al20|VFE$orWRBX$B%Hk7KcT`(< zl1f2o{sm$Yloq~8!i2wFy6q-eZQV`UKv25-C!La;csClUc9Jm5R1itEdWlzDd!FaX zsrSD}?(w>6tB~q@o%o+IB2o`6p+7kN4ca^|(YA7lIo~CIUX=ECiSH%xz)ERx=NGhh z;_)O|G%z)qB4Y)dRYjVFxX(zMG#1+rz4O7fjm!Uw1Ov6l>Ke4SXHd_PEqqLzEICai srgRXi*~r^*pH#2mPe0!tml}IWj`O!8^KREVRaI!}v8a(JOyLdx1J<{mBLDyZ diff --git a/td/telegram/CallActor.cpp b/td/telegram/CallActor.cpp index 1d82b4490..5bdeb520e 100644 --- a/td/telegram/CallActor.cpp +++ b/td/telegram/CallActor.cpp @@ -138,6 +138,10 @@ void CallActor::create_call(UserId user_id, tl_object_ptr promise) { promise.set_value(Unit()); @@ -726,7 +730,7 @@ void CallActor::on_get_call_config_result(NetQueryPtr net_query) { } void CallActor::loop() { - LOG(DEBUG) << "Enter loop for call " << call_id_ << " in state " << static_cast(state_) << '/' + LOG(DEBUG) << "Enter loop for " << call_id_ << " in state " << static_cast(state_) << '/' << static_cast(call_state_.type); flush_call_state(); switch (state_) { @@ -747,7 +751,7 @@ void CallActor::loop() { (call_state_.need_rating || call_state_.need_debug_information)) { break; } - LOG(INFO) << "Close call " << local_call_id_; + LOG(INFO) << "Close " << local_call_id_; stop(); break; } diff --git a/td/telegram/CallActor.h b/td/telegram/CallActor.h index 6adc9b987..fe57d9926 100644 --- a/td/telegram/CallActor.h +++ b/td/telegram/CallActor.h @@ -80,6 +80,7 @@ class CallActor : public NetQueryCallback { void create_call(UserId user_id, tl_object_ptr &&input_user, CallProtocol &&protocol, bool is_video, Promise &&promise); + void update_call_signaling_data(string data); void discard_call(bool is_disconnected, int32 duration, bool is_video, int64 connection_id, Promise<> promise); void accept_call(CallProtocol &&protocol, Promise<> promise); void rate_call(int32 rating, string comment, vector> &&problems, diff --git a/td/telegram/CallId.h b/td/telegram/CallId.h index 9a81d0ac8..21c27a2b9 100644 --- a/td/telegram/CallId.h +++ b/td/telegram/CallId.h @@ -53,7 +53,7 @@ struct CallIdHash { }; inline StringBuilder &operator<<(StringBuilder &sb, const CallId call_id) { - return sb << "CallId(" << call_id.get() << ")"; + return sb << "call " << call_id.get(); } } // namespace td diff --git a/td/telegram/CallManager.cpp b/td/telegram/CallManager.cpp index c09ee2d31..8e0dafe42 100644 --- a/td/telegram/CallManager.cpp +++ b/td/telegram/CallManager.cpp @@ -23,7 +23,7 @@ CallManager::CallManager(ActorShared<> parent) : parent_(std::move(parent)) { void CallManager::update_call(Update call) { int64 call_id = 0; downcast_call(*call->phone_call_, [&](auto &update) { call_id = update.id_; }); - LOG(DEBUG) << "Receive UpdateCall for call " << call_id; + LOG(DEBUG) << "Receive UpdateCall for " << call_id; auto &info = call_info_[call_id]; @@ -32,7 +32,7 @@ void CallManager::update_call(Update call) { } if (!info.call_id.is_valid()) { - LOG(INFO) << "Call_id is not valid for call " << call_id << ", postpone update " << to_string(call); + LOG(INFO) << "Call_id is not valid for " << call_id << ", postpone update " << to_string(call); info.updates.push_back(std::move(call)); return; } @@ -44,6 +44,20 @@ void CallManager::update_call(Update call) { send_closure(actor, &CallActor::update_call, std::move(call->phone_call_)); } +void CallManager::update_call_signaling_data(int64 call_id, string data) { + auto info_it = call_info_.find(call_id); + if (info_it == call_info_.end() || !info_it->second.call_id.is_valid()) { + LOG(INFO) << "Ignore signaling data for " << call_id; + } + + auto actor = get_call_actor(info_it->second.call_id); + if (actor.empty()) { + LOG(INFO) << "Ignore signaling data for " << info_it->second.call_id; + return; + } + send_closure(actor, &CallActor::update_call_signaling_data, std::move(data)); +} + void CallManager::create_call(UserId user_id, tl_object_ptr &&input_user, CallProtocol &&protocol, bool is_video, Promise promise) { LOG(INFO) << "Create call with " << user_id; diff --git a/td/telegram/CallManager.h b/td/telegram/CallManager.h index 367984d07..3a261967b 100644 --- a/td/telegram/CallManager.h +++ b/td/telegram/CallManager.h @@ -27,6 +27,7 @@ class CallManager : public Actor { using Update = telegram_api::object_ptr; explicit CallManager(ActorShared<> parent); void update_call(Update call); + void update_call_signaling_data(int64 call_id, string data); void create_call(UserId user_id, tl_object_ptr &&input_user, CallProtocol &&protocol, bool is_video, Promise promise); diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index 53b73eea7..c3cbd3968 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -3507,7 +3507,7 @@ static auto secret_to_telegram_document(secret_api::decryptedMessageMediaExterna thumbnails.push_back(secret_to_telegram(*from.thumb_)); return make_tl_object( telegram_api::document::THUMBS_MASK, from.id_, from.access_hash_, BufferSlice(), from.date_, from.mime_type_, - from.size_, std::move(thumbnails), from.dc_id_, secret_to_telegram(from.attributes_)); + from.size_, std::move(thumbnails), Auto(), from.dc_id_, secret_to_telegram(from.attributes_)); } template diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index b8337daa6..a64d2becc 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -1982,6 +1982,11 @@ void UpdatesManager::on_update(tl_object_ptr upda send_closure(G()->call_manager(), &CallManager::update_call, std::move(update)); } +void UpdatesManager::on_update(tl_object_ptr update, bool /*force_apply*/) { + send_closure(G()->call_manager(), &CallManager::update_call_signaling_data, update->phone_call_id_, + update->data_.as_slice().str()); +} + void UpdatesManager::on_update(tl_object_ptr update, bool /*force_apply*/) { td_->contacts_manager_->on_update_contacts_reset(); } diff --git a/td/telegram/UpdatesManager.h b/td/telegram/UpdatesManager.h index 28036f151..84679580b 100644 --- a/td/telegram/UpdatesManager.h +++ b/td/telegram/UpdatesManager.h @@ -272,6 +272,7 @@ class UpdatesManager : public Actor { void on_update(tl_object_ptr update, bool /*force_apply*/); void on_update(tl_object_ptr update, bool /*force_apply*/); + void on_update(tl_object_ptr update, bool /*force_apply*/); void on_update(tl_object_ptr update, bool /*force_apply*/); diff --git a/td/telegram/Version.h b/td/telegram/Version.h index 7a1c98ea0..79621b02a 100644 --- a/td/telegram/Version.h +++ b/td/telegram/Version.h @@ -8,7 +8,7 @@ namespace td { -constexpr int32 MTPROTO_LAYER = 113; +constexpr int32 MTPROTO_LAYER = 114; enum class Version : int32 { Initial,