From a297294aace618643e52957a9a2c74a4da500835 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 24 Jun 2020 11:45:36 +0300 Subject: [PATCH] Update layer to 116. GitOrigin-RevId: 7c12605195674f0b48dbc05734e99bffb2062d0c --- td/generate/scheme/telegram_api.tl | 31 +++++++++++++++++++++------- td/generate/scheme/telegram_api.tlo | Bin 206744 -> 209976 bytes td/telegram/ContactsManager.cpp | 7 +++++-- td/telegram/MessagesManager.cpp | 9 +++++--- td/telegram/Photo.cpp | 18 ++++++++++------ td/telegram/Photo.h | 1 + td/telegram/UpdatesManager.cpp | 3 +++ td/telegram/UpdatesManager.h | 2 ++ td/telegram/Version.h | 2 +- test/secret.cpp | 6 +++--- 10 files changed, 56 insertions(+), 23 deletions(-) diff --git a/td/generate/scheme/telegram_api.tl b/td/generate/scheme/telegram_api.tl index a7b3ab873..e9aa797d5 100644 --- a/td/generate/scheme/telegram_api.tl +++ b/td/generate/scheme/telegram_api.tl @@ -61,7 +61,7 @@ inputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector s inputMediaDice#e66fbf7b emoticon:string = InputMedia; inputChatPhotoEmpty#1ca48f57 = InputChatPhoto; -inputChatUploadedPhoto#927c55b4 file:InputFile = InputChatPhoto; +inputChatUploadedPhoto#c642724e flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = InputChatPhoto; inputChatPhoto#8953ad37 id:InputPhoto = InputChatPhoto; inputGeoPointEmpty#e4c123d6 = InputGeoPoint; @@ -99,7 +99,7 @@ userEmpty#200250ba id:int = User; user#938458c1 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User; userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto; -userProfilePhoto#ecd75d8c photo_id:long photo_small:FileLocation photo_big:FileLocation dc_id:int = UserProfilePhoto; +userProfilePhoto#69d3ab26 flags:# has_video:flags.0?true photo_id:long photo_small:FileLocation photo_big:FileLocation dc_id:int = UserProfilePhoto; userStatusEmpty#9d05049 = UserStatus; userStatusOnline#edb93949 expires:int = UserStatus; @@ -125,7 +125,7 @@ chatParticipantsForbidden#fc900c2b flags:# chat_id:int self_participant:flags.0? chatParticipants#3f460fed chat_id:int participants:Vector version:int = ChatParticipants; chatPhotoEmpty#37c1011c = ChatPhoto; -chatPhoto#475cdbd5 photo_small:FileLocation photo_big:FileLocation dc_id:int = ChatPhoto; +chatPhoto#d20b9f3c flags:# has_video:flags.0?true photo_small:FileLocation photo_big:FileLocation dc_id:int = ChatPhoto; messageEmpty#83e5de54 id:int = Message; message#452c0e65 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true id:int from_id:flags.8?int to_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector views:flags.10?int edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector = Message; @@ -173,7 +173,7 @@ dialog#2c171f72 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer t dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog; photoEmpty#2331b22d id:long = Photo; -photo#d07504a5 flags:# has_stickers:flags.0?true id:long access_hash:long file_reference:bytes date:int sizes:Vector dc_id:int = Photo; +photo#fb197a65 flags:# has_stickers:flags.0?true id:long access_hash:long file_reference:bytes date:int sizes:Vector video_sizes:flags.1?Vector dc_id:int = Photo; photoSizeEmpty#e17e23c type:string = PhotoSize; photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize; @@ -199,7 +199,7 @@ inputPeerNotifySettings#9c3d198e flags:# show_previews:flags.0?Bool silent:flags peerNotifySettings#af509d20 flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?string = PeerNotifySettings; -peerSettings#818426cd flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true = PeerSettings; +peerSettings#733f2961 flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true autoarchived:flags.7?true geo_distance:flags.6?int = PeerSettings; wallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper; wallPaperNoFile#8af40b25 flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper; @@ -344,6 +344,7 @@ 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; +updateChannelParticipant#65d2b464 flags:# channel_id:int date:int user_id:int prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant qts:int = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -381,7 +382,7 @@ help.inviteText#18cb9f78 message:string = help.InviteText; encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat; encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat; -encryptedChatRequested#c878527e id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat; +encryptedChatRequested#62718a82 flags:# folder_id:flags.0?int id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat; encryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat; encryptedChatDiscarded#13d6dd27 id:int = EncryptedChat; @@ -1123,7 +1124,17 @@ 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; +videoSize#e831c556 flags:# type:string location:FileLocation w:int h:int size:int video_start_ts:flags.0?double = VideoSize; + +statsGroupTopPoster#18f3d0f7 user_id:int messages:int avg_chars:int = StatsGroupTopPoster; + +statsGroupTopAdmin#6014f412 user_id:int deleted:int kicked:int banned:int = StatsGroupTopAdmin; + +statsGroupTopInviter#31962a4c user_id:int invitations:int = StatsGroupTopInviter; + +stats.megagroupStats#ef7ff916 period:StatsDateRangeDays members:StatsAbsValueAndPrev messages:StatsAbsValueAndPrev viewers:StatsAbsValueAndPrev posters:StatsAbsValueAndPrev growth_graph:StatsGraph members_graph:StatsGraph new_members_by_source_graph:StatsGraph languages_graph:StatsGraph messages_graph:StatsGraph actions_graph:StatsGraph top_hours_graph:StatsGraph weekdays_graph:StatsGraph top_posters:Vector top_admins:Vector top_inviters:Vector users:Vector = stats.MegagroupStats; + +globalPrivacySettings#bea2f424 flags:# archive_and_mute_new_noncontact_peers:flags.0?Bool = GlobalPrivacySettings; ---functions--- @@ -1219,6 +1230,8 @@ account.getThemes#285946f8 format:string hash:int = account.Themes; account.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool; account.getContentSettings#8b9b4dae = account.ContentSettings; account.getMultiWallPapers#65ad71dc wallpapers:Vector = Vector; +account.getGlobalPrivacySettings#eb2b4cf6 = GlobalPrivacySettings; +account.setGlobalPrivacySettings#1edaaac2 settings:GlobalPrivacySettings = GlobalPrivacySettings; users.getUsers#d91a548 id:Vector = Vector; users.getFullUser#ca30a5b1 id:InputUser = UserFull; @@ -1373,7 +1386,7 @@ updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date: updates.getChannelDifference#3173d78 flags:# force:flags.0?true channel:InputChannel filter:ChannelMessagesFilter pts:int limit:int = updates.ChannelDifference; photos.updateProfilePhoto#f0bb5152 id:InputPhoto = UserProfilePhoto; -photos.uploadProfilePhoto#4f32c098 file:InputFile = photos.Photo; +photos.uploadProfilePhoto#89f30f69 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = photos.Photo; photos.deletePhotos#87cf7f2f id:Vector = Vector; photos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int = photos.Photos; @@ -1406,6 +1419,7 @@ help.getUserInfo#38a08d3 user_id:InputUser = help.UserInfo; help.editUserInfo#66b91b70 user_id:InputUser message:string entities:Vector = help.UserInfo; help.getPromoData#c0977421 = help.PromoData; help.hidePromoData#1e251c95 peer:InputPeer = Bool; +help.dismissSuggestion#77fa99f suggestion:string = Bool; channels.readHistory#cc104937 channel:InputChannel max_id:int = Bool; channels.deleteMessages#84c1fd4e channel:InputChannel id:Vector = messages.AffectedMessages; @@ -1482,3 +1496,4 @@ folders.deleteFolder#1c295881 folder_id:int = Updates; stats.getBroadcastStats#ab42441a flags:# dark:flags.0?true channel:InputChannel = stats.BroadcastStats; stats.loadAsyncGraph#621d5fa0 flags:# token:string x:flags.0?long = StatsGraph; +stats.getMegagroupStats#dcdf8607 flags:# dark:flags.0?true channel:InputChannel = stats.MegagroupStats; diff --git a/td/generate/scheme/telegram_api.tlo b/td/generate/scheme/telegram_api.tlo index a7ac20bb4561c4af3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1IvTpE}kQtOo9i$ zRe^q{9NKHblN&TaRoV}^aE%IU%urO*+5Ro)A-wWlRE-NNWawe$Bm+w*0Vn28K^;Bt zpPCmBQu?FSxbGAzQ|1(_U*A66=G{Z^0QSER398Cz>{QgCoAQP==I1+&by46nLt(CC zoM%`P!QYBX=!_d@PXnjOZ@QG3$IYS*pJBH0o1li;7yf4I%{6J7u@nJ|*fj(xDmp#H z+{zgcapD@(kSoT_JC$OmxfBaD_yOZ}e*ityisvi?!+(|q(Rr37o~VY0@Ub7!%T&1T z9JrmVt;sC1E5ayk$2kygf0{bS5Fu#?oJ~Y7*@KKS05oRho!mbYP<9RoM758_e^|<|GCKuPK z;#hNdX&Row!W9s3cq5eKz$mz=<+f3?cuKKAy4WZ^%+HtZGS+CWm;?x z67MpWKrP#ggq2#uAj&T>R#j|tZ})$Z1E*Y8m*VKB3$>O$kJ2_n2MgbTpbd z;y5ePjj#P{C;y3RjZaPZ7fO5SZxVg~EWZ`d-t;e@!EU$J4Rm$IdAD^~ K3*Kj)Ec-v_fBxnG diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index b2d856fc4..3e09dcad9 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -815,7 +815,9 @@ class UploadProfilePhotoQuery : public Td::ResultHandler { file_id_ = file_id; - send_query(G()->net_query_creator().create(telegram_api::photos_uploadProfilePhoto(std::move(input_file)))); + int32 flags = telegram_api::photos_uploadProfilePhoto::FILE_MASK; + send_query(G()->net_query_creator().create( + telegram_api::photos_uploadProfilePhoto(flags, std::move(input_file), nullptr, 0))); } void on_result(uint64 id, BufferSlice packet) override { @@ -7363,7 +7365,8 @@ ContactsManager::User *ContactsManager::get_user_force(UserId user_id) { telegram_api::user::PHONE_MASK | telegram_api::user::PHOTO_MASK | telegram_api::user::VERIFIED_MASK | telegram_api::user::SUPPORT_MASK; auto profile_photo = telegram_api::make_object( - 3337190045231023, telegram_api::make_object(107738948, 13226), + 0, false /*ignored*/, 3337190045231023, + telegram_api::make_object(107738948, 13226), telegram_api::make_object(107738948, 13228), 1); if (G()->is_test_dc()) { profile_photo = nullptr; diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index c395e9b30..67cbe7c97 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -3607,7 +3607,8 @@ class UpdatePeerSettingsQuery : public Td::ResultHandler { td->messages_manager_->on_get_peer_settings( dialog_id_, make_tl_object(0, false /*ignored*/, false /*ignored*/, false /*ignored*/, - false /*ignored*/, false /*ignored*/, false /*ignored*/), + false /*ignored*/, false /*ignored*/, false /*ignored*/, + false /*ignored*/, 0), true); promise_.set_value(Unit()); @@ -3648,7 +3649,8 @@ class ReportEncryptedSpamQuery : public Td::ResultHandler { td->messages_manager_->on_get_peer_settings( dialog_id_, make_tl_object(0, false /*ignored*/, false /*ignored*/, false /*ignored*/, - false /*ignored*/, false /*ignored*/, false /*ignored*/), + false /*ignored*/, false /*ignored*/, false /*ignored*/, + false /*ignored*/, 0), true); promise_.set_value(Unit()); @@ -7838,7 +7840,8 @@ void MessagesManager::on_upload_dialog_photo(FileId file_id, tl_object_ptr(std::move(input_photo)); } else { - input_chat_photo = make_tl_object(std::move(input_file)); + int32 flags = telegram_api::inputChatUploadedPhoto::FILE_MASK; + input_chat_photo = make_tl_object(flags, std::move(input_file), nullptr, 0.0); } send_edit_dialog_photo_query(dialog_id, file_id, std::move(input_chat_photo), std::move(promise)); diff --git a/td/telegram/Photo.cpp b/td/telegram/Photo.cpp index 8f525ac1f..c362536a7 100644 --- a/td/telegram/Photo.cpp +++ b/td/telegram/Photo.cpp @@ -164,6 +164,7 @@ ProfilePhoto get_profile_photo(FileManager *file_manager, UserId user_id, int64 auto profile_photo = move_tl_object_as(profile_photo_ptr); auto dc_id = DcId::create(profile_photo->dc_id_); + result.is_animated = (profile_photo->flags_ & telegram_api::userProfilePhoto::HAS_VIDEO_MASK) != 0; result.id = profile_photo->photo_id_; result.small_file_id = register_photo(file_manager, {DialogId(user_id), user_access_hash, false}, result.id, 0, "", @@ -206,7 +207,7 @@ bool operator==(const ProfilePhoto &lhs, const ProfilePhoto &rhs) { << ", second profilePhoto: " << rhs; return false; } - return true; + return lhs.is_animated == rhs.is_animated && !id_differs; } bool operator!=(const ProfilePhoto &lhs, const ProfilePhoto &rhs) { @@ -215,7 +216,8 @@ bool operator!=(const ProfilePhoto &lhs, const ProfilePhoto &rhs) { StringBuilder &operator<<(StringBuilder &string_builder, const ProfilePhoto &profile_photo) { return string_builder << ""; + << ", big_file_id = " << profile_photo.big_file_id + << ", is_animated = " << profile_photo.is_animated << ">"; } DialogPhoto get_dialog_photo(FileManager *file_manager, DialogId dialog_id, int64 dialog_access_hash, @@ -230,6 +232,7 @@ DialogPhoto get_dialog_photo(FileManager *file_manager, DialogId dialog_id, int6 auto chat_photo = move_tl_object_as(chat_photo_ptr); auto dc_id = DcId::create(chat_photo->dc_id_); + result.is_animated = (chat_photo->flags_ & telegram_api::chatPhoto::HAS_VIDEO_MASK) != 0; result.small_file_id = register_photo(file_manager, {dialog_id, dialog_access_hash, false}, 0, 0, "", std::move(chat_photo->photo_small_), DialogId(), 0, dc_id, PhotoFormat::Jpeg); @@ -285,7 +288,8 @@ DialogPhoto as_dialog_photo(const Photo &photo) { } bool operator==(const DialogPhoto &lhs, const DialogPhoto &rhs) { - return lhs.small_file_id == rhs.small_file_id && lhs.big_file_id == rhs.big_file_id; + return lhs.small_file_id == rhs.small_file_id && lhs.big_file_id == rhs.big_file_id && + lhs.is_animated == rhs.is_animated; } bool operator!=(const DialogPhoto &lhs, const DialogPhoto &rhs) { @@ -294,7 +298,8 @@ bool operator!=(const DialogPhoto &lhs, const DialogPhoto &rhs) { StringBuilder &operator<<(StringBuilder &string_builder, const DialogPhoto &dialog_photo) { return string_builder << ""; + << ", big_file_id = " << dialog_photo.big_file_id + << ", is_animated = " << dialog_photo.is_animated << ">"; } PhotoSize get_secret_thumbnail_photo_size(FileManager *file_manager, BufferSlice bytes, DialogId owner_dialog_id, @@ -859,8 +864,9 @@ tl_object_ptr convert_photo_to_profile_photo( if (photo_small == nullptr || photo_big == nullptr) { return nullptr; } - return make_tl_object(photo->id_, std::move(photo_small), std::move(photo_big), - photo->dc_id_); + int32 flags = 0; + return make_tl_object(flags, false /*ignored*/, photo->id_, std::move(photo_small), + std::move(photo_big), photo->dc_id_); } } // namespace td diff --git a/td/telegram/Photo.h b/td/telegram/Photo.h index c6643d44d..0eb0c33ad 100644 --- a/td/telegram/Photo.h +++ b/td/telegram/Photo.h @@ -36,6 +36,7 @@ struct Dimensions { struct DialogPhoto { FileId small_file_id; FileId big_file_id; + bool is_animated = false; }; struct ProfilePhoto : public DialogPhoto { diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index 4b9ab4dde..9066be3da 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -2047,4 +2047,7 @@ void UpdatesManager::on_update(tl_object_ptr upd void UpdatesManager::on_update(tl_object_ptr update, bool /*force_apply*/) { } +void UpdatesManager::on_update(tl_object_ptr update, bool /*force_apply*/) { +} + } // namespace td diff --git a/td/telegram/UpdatesManager.h b/td/telegram/UpdatesManager.h index 2e12f3c38..60dfca28d 100644 --- a/td/telegram/UpdatesManager.h +++ b/td/telegram/UpdatesManager.h @@ -296,6 +296,8 @@ class UpdatesManager : public Actor { // unsupported updates void on_update(tl_object_ptr update, bool /*force_apply*/); + + void on_update(tl_object_ptr update, bool /*force_apply*/); }; } // namespace td diff --git a/td/telegram/Version.h b/td/telegram/Version.h index 47a830e09..4fa2825a9 100644 --- a/td/telegram/Version.h +++ b/td/telegram/Version.h @@ -8,7 +8,7 @@ namespace td { -constexpr int32 MTPROTO_LAYER = 115; +constexpr int32 MTPROTO_LAYER = 116; enum class Version : int32 { Initial, diff --git a/test/secret.cpp b/test/secret.cpp index 6be988d4e..abcd68f22 100644 --- a/test/secret.cpp +++ b/test/secret.cpp @@ -838,9 +838,9 @@ class Master : public Actor { CHECK(get_link_token() == 1); send_closure(alice_->get_actor_unsafe()->actor_, &SecretChatActor::update_chat, make_tl_object(123, 321, 0, 1, 2)); - send_closure( - bob_->get_actor_unsafe()->actor_, &SecretChatActor::update_chat, - make_tl_object(123, 321, 0, 1, 2, request_encryption.g_a_.clone())); + send_closure(bob_->get_actor_unsafe()->actor_, &SecretChatActor::update_chat, + make_tl_object(0, false, 123, 321, 0, 1, 2, + request_encryption.g_a_.clone())); net_query->clear(); } void process_net_query(my_api::messages_acceptEncryption &&request_encryption, NetQueryPtr net_query,