Update layer to 114.

GitOrigin-RevId: 8cfc80aa94c507de56d068472e152fb8aa0ab8a9
This commit is contained in:
levlam 2020-05-29 11:26:08 +03:00
parent 82d14a6ec1
commit 3d8ff7f852
11 changed files with 38 additions and 15 deletions

View File

@ -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<DocumentAttribute> stickers:flags.0?Vector<InputDocument> 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<bytes> =
updateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update;
updateDialogFilterOrder#a5d72105 order:Vector<int> = 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<PhotoSize> dc_id:int attributes:Vector<DocumentAttribute> = Document;
document#1e87342b flags:# id:long access_hash:long file_reference:bytes date:int mime_type:string size:int thumbs:flags.0?Vector<PhotoSize> video_thumbs:flags.1?Vector<VideoSize> dc_id:int attributes:Vector<DocumentAttribute> = 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<MessageEntity> 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<FoundGif> = messages.FoundGifs;
messages.savedGifsNotModified#e8025ca2 = messages.SavedGifs;
messages.savedGifs#2e0709a5 hash:int gifs:Vector<Document> = 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<Chat> users:Vector<User> 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<long> = 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<string> = Vector<LangPackString>;

Binary file not shown.

View File

@ -138,6 +138,10 @@ void CallActor::create_call(UserId user_id, tl_object_ptr<telegram_api::InputUse
promise.set_value(CallId(local_call_id_));
}
void CallActor::update_call_signaling_data(string data) {
// nothing to do
}
void CallActor::discard_call(bool is_disconnected, int32 duration, bool is_video, int64 connection_id,
Promise<> 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<int32>(state_) << '/'
LOG(DEBUG) << "Enter loop for " << call_id_ << " in state " << static_cast<int32>(state_) << '/'
<< static_cast<int32>(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;
}

View File

@ -80,6 +80,7 @@ class CallActor : public NetQueryCallback {
void create_call(UserId user_id, tl_object_ptr<telegram_api::InputUser> &&input_user, CallProtocol &&protocol,
bool is_video, Promise<CallId> &&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<td_api::object_ptr<td_api::CallProblem>> &&problems,

View File

@ -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

View File

@ -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<telegram_api::InputUser> &&input_user,
CallProtocol &&protocol, bool is_video, Promise<CallId> promise) {
LOG(INFO) << "Create call with " << user_id;

View File

@ -27,6 +27,7 @@ class CallManager : public Actor {
using Update = telegram_api::object_ptr<telegram_api::updatePhoneCall>;
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<telegram_api::InputUser> &&input_user, CallProtocol &&protocol,
bool is_video, Promise<CallId> promise);

View File

@ -3507,7 +3507,7 @@ static auto secret_to_telegram_document(secret_api::decryptedMessageMediaExterna
thumbnails.push_back(secret_to_telegram<telegram_api::PhotoSize>(*from.thumb_));
return make_tl_object<telegram_api::document>(
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 <class ToT, class FromT>

View File

@ -1982,6 +1982,11 @@ void UpdatesManager::on_update(tl_object_ptr<telegram_api::updatePhoneCall> upda
send_closure(G()->call_manager(), &CallManager::update_call, std::move(update));
}
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updatePhoneCallSignalingData> 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<telegram_api::updateContactsReset> update, bool /*force_apply*/) {
td_->contacts_manager_->on_update_contacts_reset();
}

View File

@ -272,6 +272,7 @@ class UpdatesManager : public Actor {
void on_update(tl_object_ptr<telegram_api::updateBotWebhookJSONQuery> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updatePhoneCall> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updatePhoneCallSignalingData> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateContactsReset> update, bool /*force_apply*/);

View File

@ -8,7 +8,7 @@
namespace td {
constexpr int32 MTPROTO_LAYER = 113;
constexpr int32 MTPROTO_LAYER = 114;
enum class Version : int32 {
Initial,