From 642a9a9efbb9b833f49c46b77231df541e699880 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 2 Feb 2021 02:00:28 +0300 Subject: [PATCH] Update layer to 124. --- td/generate/scheme/td_api.tl | 37 +++++++++++++++ td/generate/scheme/td_api.tlo | Bin 194284 -> 195528 bytes td/generate/scheme/telegram_api.tl | 70 +++++++++++++++++++++------- td/generate/scheme/telegram_api.tlo | Bin 227148 -> 233316 bytes td/telegram/ConfigManager.cpp | 3 +- td/telegram/ContactsManager.cpp | 32 ++++++------- td/telegram/ContactsManager.h | 4 +- td/telegram/DialogParticipant.cpp | 2 +- td/telegram/MessagesManager.cpp | 54 ++++++++++++--------- td/telegram/MessagesManager.h | 4 +- td/telegram/Td.cpp | 4 +- td/telegram/Td.h | 4 +- td/telegram/UpdatesManager.cpp | 17 ++++++- td/telegram/UpdatesManager.h | 12 ++++- td/telegram/Version.h | 2 +- td/telegram/cli.cpp | 2 - 16 files changed, 171 insertions(+), 76 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index dc7e6486c..0f89c6d6c 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -4419,6 +4419,43 @@ importMessages chat_id:int53 message_file:InputFile attached_files:vectorLQ&MwMOHv(ka)MIJ^0QM@ zP)#VF-eAP!vVDm+(*hQSdLH$O(h&7n6;FR~mdS8(t*7vG13M;>X}6gKx4Q-~nX||o z{`Ky@P-;qM398{x$9)4juEtXYq={#8zyj9EGb`QUF0Bb+DiGtCCAsaWM0#q;2J>AJg_l!b+$24{l9H9iLzu+#JR zGMP>;*vL6~Wi9{qH(5+y+!a1*L@ admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat; +channel#d31a961e flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true id:int access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?Vector admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat; channelForbidden#289da732 flags:# broadcast:flags.5?true megagroup:flags.8?true id:int access_hash:long title:string until_date:flags.16?int = Chat; -chatFull#f3474af6 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:int about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall = ChatFull; -channelFull#7a7de4f7 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?int location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall = ChatFull; +chatFull#f06c4018 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:int about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int = ChatFull; +channelFull#2548c037 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?int location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector = ChatFull; chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant; chatParticipantCreator#da13538a user_id:int = ChatParticipant; @@ -128,8 +128,8 @@ chatPhotoEmpty#37c1011c = ChatPhoto; chatPhoto#d20b9f3c flags:# has_video:flags.0?true photo_small:FileLocation photo_big:FileLocation dc_id:int = ChatPhoto; messageEmpty#90a6ca84 flags:# id:int peer_id:flags.0?Peer = Message; -message#58ae39c9 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 pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector = Message; -messageService#286fa604 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction = Message; +message#bce383d2 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 pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector ttl_period:flags.25?int = Message; +messageService#2b085862 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction ttl_period:flags.25?int = Message; messageMediaEmpty#3ded6320 = MessageMedia; messageMediaPhoto#695150d7 flags:# photo:flags.0?Photo ttl_seconds:flags.2?int = MessageMedia; @@ -171,6 +171,7 @@ messageActionContactSignUp#f3f25f76 = MessageAction; messageActionGeoProximityReached#98e0d697 from_id:Peer to_id:Peer distance:int = MessageAction; messageActionGroupCall#7a0d7f42 flags:# call:InputGroupCall duration:flags.0?int = MessageAction; messageActionInviteToGroupCall#76b9f11a call:InputGroupCall users:Vector = MessageAction; +messageActionSetMessagesTTL#aa1afbfd period:int = MessageAction; dialog#2c171f72 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int = Dialog; 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; @@ -213,12 +214,12 @@ inputReportReasonSpam#58dbcab8 = ReportReason; inputReportReasonViolence#1e22c78d = ReportReason; inputReportReasonPornography#2e59d922 = ReportReason; inputReportReasonChildAbuse#adf44ee3 = ReportReason; -inputReportReasonOther#e1746d0a text:string = ReportReason; +inputReportReasonOther#c1e4a2b1 = ReportReason; inputReportReasonCopyright#9b89f93a = ReportReason; inputReportReasonGeoIrrelevant#dbd4feed = ReportReason; inputReportReasonFake#f5ddd6e7 = ReportReason; -userFull#edf17c12 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int = UserFull; +userFull#139a9a77 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int = UserFull; contact#f911c994 user_id:int mutual:Bool = Contact; @@ -345,7 +346,6 @@ 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; updateChannelMessageForwards#6e8a84df channel_id:int id:int forwards:int = Update; updateReadChannelDiscussionInbox#1cc7de54 flags:# channel_id:int top_msg_id:int read_max_id:int broadcast_id:flags.0?int broadcast_post:flags.0?int = Update; updateReadChannelDiscussionOutbox#4638a26c channel_id:int top_msg_id:int read_max_id:int = Update; @@ -356,6 +356,10 @@ updatePinnedChannelMessages#8588878b flags:# pinned:flags.0?true channel_id:int updateChat#1330a196 chat_id:int = Update; updateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector version:int = Update; updateGroupCall#a45eb99b chat_id:int call:GroupCall = Update; +updatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update; +updateChatParticipant#439b2b39 flags:# chat_id:int date:int user_id:int prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update; +updateChannelParticipant#961adf2 flags:# channel_id:int date:int user_id:int prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update; +updateBotStopped#7f9488a user_id:int date:int stopped:Bool qts:int = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -365,12 +369,12 @@ updates.differenceSlice#a8fb1981 new_messages:Vector new_encrypted_mess updates.differenceTooLong#4afe8f6d pts:int = updates.Difference; updatesTooLong#e317af7e = Updates; -updateShortMessage#2296d2c8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector = Updates; -updateShortChatMessage#402d5dbb flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector = Updates; +updateShortMessage#faeff833 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector ttl_period:flags.25?int = Updates; +updateShortChatMessage#1157b858 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector ttl_period:flags.25?int = Updates; updateShort#78d4dec1 update:Update date:int = Updates; updatesCombined#725b04c3 updates:Vector users:Vector chats:Vector date:int seq_start:int seq:int = Updates; updates#74ae4240 updates:Vector users:Vector chats:Vector date:int seq:int = Updates; -updateShortSentMessage#11f1331c flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector = Updates; +updateShortSentMessage#9015e101 flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector ttl_period:flags.25?int = Updates; photos.photos#8dca6aa5 photos:Vector users:Vector = photos.Photos; photos.photosSlice#15051f54 count:int photos:Vector users:Vector = photos.Photos; @@ -873,12 +877,18 @@ channelAdminLogEventActionDiscardGroupCall#db9f9140 call:InputGroupCall = Channe channelAdminLogEventActionParticipantMute#f92424d2 participant:GroupCallParticipant = ChannelAdminLogEventAction; channelAdminLogEventActionParticipantUnmute#e64429c0 participant:GroupCallParticipant = ChannelAdminLogEventAction; channelAdminLogEventActionToggleGroupCallSetting#56d6a247 join_muted:Bool = ChannelAdminLogEventAction; +channelAdminLogEventActionParticipantJoinByInvite#5cdada77 invite:ExportedChatInvite = ChannelAdminLogEventAction; +channelAdminLogEventActionExportedInviteDelete#5a50fca4 invite:ExportedChatInvite = ChannelAdminLogEventAction; +channelAdminLogEventActionExportedInviteRevoke#410a134e invite:ExportedChatInvite = ChannelAdminLogEventAction; +channelAdminLogEventActionExportedInviteEdit#e90ebb59 prev_invite:ExportedChatInvite new_invite:ExportedChatInvite = ChannelAdminLogEventAction; +channelAdminLogEventActionParticipantVolume#3e7f6847 participant:GroupCallParticipant = ChannelAdminLogEventAction; +channelAdminLogEventActionChangeHistoryTTL#6e941a38 prev_value:int new_value:int = ChannelAdminLogEventAction; channelAdminLogEvent#3b5a3e40 id:long date:int user_id:int action:ChannelAdminLogEventAction = ChannelAdminLogEvent; channels.adminLogResults#ed8af74d events:Vector chats:Vector users:Vector = channels.AdminLogResults; -channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true = ChannelAdminLogEventsFilter; +channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?true = ChannelAdminLogEventsFilter; popularContact#5ce14175 client_id:long importers:int = PopularContact; @@ -1036,7 +1046,7 @@ chatOnlines#f041e250 onlines:int = ChatOnlines; statsURL#47a971e0 url:string = StatsURL; -chatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true = ChatAdminRights; +chatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true = ChatAdminRights; chatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true send_polls:flags.8?true change_info:flags.10?true invite_users:flags.15?true pin_messages:flags.17?true until_date:int = ChatBannedRights; @@ -1201,6 +1211,21 @@ messages.historyImportParsed#5e0fb7b9 flags:# pm:flags.0?true group:flags.1?true messages.affectedFoundMessages#ef8d3e6c pts:int pts_count:int offset:int messages:Vector = messages.AffectedFoundMessages; +chatInviteImporter#1e3e6680 user_id:int date:int = ChatInviteImporter; + +messages.exportedChatInvites#bdc62dcc count:int invites:Vector users:Vector = messages.ExportedChatInvites; + +messages.exportedChatInvite#1871be50 invite:ExportedChatInvite users:Vector = messages.ExportedChatInvite; +messages.exportedChatInviteReplaced#222600ef invite:ExportedChatInvite new_invite:ExportedChatInvite users:Vector = messages.ExportedChatInvite; + +messages.chatInviteImporters#81b6b00a count:int importers:Vector users:Vector = messages.ChatInviteImporters; + +chatAdminWithInvites#dfd2330f admin_id:int invites_count:int revoked_invites_count:int = ChatAdminWithInvites; + +messages.chatAdminsWithInvites#b69b72d7 admins:Vector users:Vector = messages.ChatAdminsWithInvites; + +messages.checkedHistoryImportPeer#a24de717 confirm_text:string = messages.CheckedHistoryImportPeer; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -1238,7 +1263,7 @@ account.resetNotifySettings#db7e1747 = Bool; account.updateProfile#78515775 flags:# first_name:flags.0?string last_name:flags.1?string about:flags.2?string = User; account.updateStatus#6628562c offline:Bool = Bool; account.getWallPapers#aabb1763 hash:int = account.WallPapers; -account.reportPeer#ae189d5f peer:InputPeer reason:ReportReason = Bool; +account.reportPeer#c5ba3d86 peer:InputPeer reason:ReportReason message:string = Bool; account.checkUsername#2714d86c username:string = Bool; account.updateUsername#3e0bdd7c username:string = User; account.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules; @@ -1297,6 +1322,7 @@ account.getContentSettings#8b9b4dae = account.ContentSettings; account.getMultiWallPapers#65ad71dc wallpapers:Vector = Vector; account.getGlobalPrivacySettings#eb2b4cf6 = GlobalPrivacySettings; account.setGlobalPrivacySettings#1edaaac2 settings:GlobalPrivacySettings = GlobalPrivacySettings; +account.reportProfilePhoto#fa8cc6f5 peer:InputPeer photo_id:InputPhoto reason:ReportReason message:string = Bool; users.getUsers#d91a548 id:Vector = Vector; users.getFullUser#ca30a5b1 id:InputUser = UserFull; @@ -1337,7 +1363,7 @@ messages.sendMedia#3491eba9 flags:# silent:flags.5?true background:flags.6?true messages.forwardMessages#d9fee60e flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true from_peer:InputPeer id:Vector random_id:Vector to_peer:InputPeer schedule_date:flags.10?int = Updates; messages.reportSpam#cf1592db peer:InputPeer = Bool; messages.getPeerSettings#3672e09c peer:InputPeer = PeerSettings; -messages.report#bd82b658 peer:InputPeer id:Vector reason:ReportReason = Bool; +messages.report#8953ab4e peer:InputPeer id:Vector reason:ReportReason message:string = Bool; messages.getChats#3c6aa187 id:Vector = messages.Chats; messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull; messages.editChatTitle#dc452855 chat_id:int title:string = Updates; @@ -1360,7 +1386,7 @@ messages.readMessageContents#36a73f77 id:Vector = messages.AffectedMessages messages.getStickers#43d4f2c emoticon:string hash:int = messages.Stickers; messages.getAllStickers#1c9618b1 hash:int = messages.AllStickers; messages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector = MessageMedia; -messages.exportChatInvite#df7534c peer:InputPeer = ExportedChatInvite; +messages.exportChatInvite#14b9bcd7 flags:# legacy_revoke_permanent:flags.2?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int = ExportedChatInvite; messages.checkChatInvite#3eadb1bb hash:string = ChatInvite; messages.importChatInvite#6c50051c hash:string = Updates; messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet; @@ -1456,6 +1482,15 @@ messages.checkHistoryImport#43fe19f3 import_head:string = messages.HistoryImport messages.initHistoryImport#34090c3b peer:InputPeer file:InputFile media_count:int = messages.HistoryImport; messages.uploadImportedMedia#2a862092 peer:InputPeer import_id:long file_name:string media:InputMedia = MessageMedia; messages.startHistoryImport#b43df344 peer:InputPeer import_id:long = Bool; +messages.getExportedChatInvites#a2b5a3f6 flags:# revoked:flags.3?true peer:InputPeer admin_id:InputUser offset_date:flags.2?int offset_link:flags.2?string limit:int = messages.ExportedChatInvites; +messages.getExportedChatInvite#73746f5c peer:InputPeer link:string = messages.ExportedChatInvite; +messages.editExportedChatInvite#2e4ffbe flags:# revoked:flags.2?true peer:InputPeer link:string expire_date:flags.0?int usage_limit:flags.1?int = messages.ExportedChatInvite; +messages.deleteRevokedExportedChatInvites#56987bd5 peer:InputPeer admin_id:InputUser = Bool; +messages.deleteExportedChatInvite#d464a42b peer:InputPeer link:string = Bool; +messages.getAdminsWithInvites#3920e6ef peer:InputPeer = messages.ChatAdminsWithInvites; +messages.getChatInviteImporters#26fb7289 peer:InputPeer link:string offset_date:int offset_user:InputUser limit:int = messages.ChatInviteImporters; +messages.setHistoryTTL#b80e5fe4 peer:InputPeer period:int = Updates; +messages.checkHistoryImportPeer#5dc60f03 peer:InputPeer = messages.CheckedHistoryImportPeer; updates.getState#edd4882a = updates.State; updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference; @@ -1495,7 +1530,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; +help.dismissSuggestion#f50dbaa1 peer:InputPeer suggestion:string = Bool; help.getCountriesList#735787a8 lang_code:string hash:int = help.CountriesList; channels.readHistory#cc104937 channel:InputChannel max_id:int = Bool; @@ -1533,6 +1568,7 @@ channels.editCreator#8f38cd1f channel:InputChannel user_id:InputUser password:In channels.editLocation#58e63f6d channel:InputChannel geo_point:InputGeoPoint address:string = Bool; channels.toggleSlowMode#edd49ef0 channel:InputChannel seconds:int = Updates; channels.getInactiveChannels#11e831ee = messages.InactiveChats; +channels.convertToGigagroup#b290c69 channel:InputChannel = Updates; bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON; bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool; diff --git a/td/generate/scheme/telegram_api.tlo b/td/generate/scheme/telegram_api.tlo index 450582c74b0a77d74a08f9b491af26f24e219f58..f9bb1d3b8a9c98a42f80d4fdad8825228ff6b206 100644 GIT binary patch delta 9368 zcmb_Ce^``N)^qP2V9-H^9M&-hea%tF7;q@Q4GncjTge6+6qS?`f>BsUm|!q`mUd^$ zZK;R-n)MQwU8#>+-F!B-9T&Hu&1&4oHTy&x%OBKIk&#(ZPNhbP_1*j4_YMOH-~O@u zb?4mk`<#2uz2~Lti-f+XCMBHRHGiQ>`MZ5z!gEl)B4M&0AAm+6;rr2)jxclpL*mVE zzOP?eUgF6q+gee%uEJA(N9DE(kMp-7Beton3G=xZThwN~chlnO z*D)wZzGJJqsv3uGHg*Kn4qZZKQeIqKp0lQ=WU~`7QOWOBK6W`lf#j5WDyk|~s%iLO zs-dGK`K>s0?I+fK9a$;au?h8-=lWvTxXVgBPSpndbcz8r?>dKDXSvl6{QmcoJ9H+E z)^w(N*9+6Pa`rXp5#4Ksl&?|kwB||^{4e~{I1DdJTaUAvnV4&}%$f3W-ZL|!@SLSv zoMpKcHJ+;K?XqPahm&GIbv^c2TclTCS+{Un1pD?nYPrW*HslNJMh2-X?eNP(qDLc9 z(H+{1zBusfjxV!jP3Dm?*zNLSXI>!(9I|H(2NdOH4+jk7aSWWfQlas!R3OC#nVgII zE>46akovn69Pb*VfdxyXN%hiLi)PUy2jxWR7g%P8NzJgZ!y%20-r)Fmm<~9y4UGHS zh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u3|BHXvsF=Yj7Xg{)E&#* zo^j)2Ldz;xe@l4U*rFeyHreKtCM;`QYtYj9ouleAx=vgeEd4CZ2s%G)2JZ@_fqR^dvG_yt$Y`=d+Wiy z*v-Mh6=M4c*qux`%1|i79*4ZjTYth+N3)96e1vyuE5%Wb4Wo6>?K6J@uD@Xm6ef}s z$UTUSaq6eUDCM1lc!dR=hk3WCwUQ;DNvS!E>GebFkcKw8-L#eAFl_{NrC5&OdK7Ix z9sKbqUL<$t(H`n~Y!_ zM@)>=aZI48OpuQAzl!@fHY5zHL3J|CyY*Z8xyfvw7S^J^gLLL+v=0JjFwr!EVLS^S zKTjvRrr&jrP84-DgkE%>V`%h$N9DWE<7!P_uIVv@@%O|4jTh*!(7;+QaIdwoY3ssG zjNaXa{cPp^hIXPRn|%>iaN66%p{X1?!cHzG%IxuF~D3!YEx=@xUDnk$%N20Dn9E zAWV-Zyd6C8q#Y^~NF-_s%Nu{34FdEiYGlWW>2dPgdumMXW=FJAk6dh&QTk$fi7zDXoNeQ(y>&e%-s zY(-zv(%{oAWD$fn6Q@Q~Bp+$!$)nFv93_8?FyvpxR9<8V_N^QqsIVQ}*XXwDe+u12 xXnvIHtt7yE!Lf}rF%A88o^S0HY~6OUgxPJ}PTa{l_2e5eaJ0kF`8F}5{{aI%;*9_R diff --git a/td/telegram/ConfigManager.cpp b/td/telegram/ConfigManager.cpp index 6dcc93712..80515e326 100644 --- a/td/telegram/ConfigManager.cpp +++ b/td/telegram/ConfigManager.cpp @@ -1097,7 +1097,8 @@ void ConfigManager::dismiss_suggested_action(SuggestedAction suggested_action, P queries.push_back(std::move(promise)); if (queries.size() == 1) { G()->net_query_dispatcher().dispatch_with_callback( - G()->net_query_creator().create(telegram_api::help_dismissSuggestion(action_str)), + G()->net_query_creator().create( + telegram_api::help_dismissSuggestion(make_tl_object(), action_str)), actor_shared(this, 100 + static_cast(suggested_action))); } } diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index 448f4caf5..e97ce4311 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -1582,9 +1582,7 @@ class ExportChatInviteLinkQuery : public Td::ResultHandler { if (input_peer == nullptr) { return on_error(0, Status::Error(400, "Can't access the chat")); } - CHECK(is_permanent); - /* int32 flags = 0; if (expire_date > 0) { flags |= telegram_api::messages_exportChatInvite::EXPIRE_DATE_MASK; @@ -1595,11 +1593,9 @@ class ExportChatInviteLinkQuery : public Td::ResultHandler { if (is_permanent) { flags |= telegram_api::messages_exportChatInvite::LEGACY_REVOKE_PERMANENT_MASK; } - */ - send_query(G()->net_query_creator().create(telegram_api::messages_exportChatInvite(std::move(input_peer)))); - // send_query(G()->net_query_creator().create(telegram_api::messages_exportChatInvite( - // flags, false /*ignored*/, std::move(input_peer), expire_date, usage_limit))); + send_query(G()->net_query_creator().create(telegram_api::messages_exportChatInvite( + flags, false /*ignored*/, std::move(input_peer), expire_date, usage_limit))); } void on_result(uint64 id, BufferSlice packet) override { @@ -1629,7 +1625,7 @@ class ExportChatInviteLinkQuery : public Td::ResultHandler { promise_.set_error(std::move(status)); } }; -/* + class EditChatInviteLinkQuery : public Td::ResultHandler { Promise> promise_; DialogId dialog_id_; @@ -1652,7 +1648,7 @@ class EditChatInviteLinkQuery : public Td::ResultHandler { flags |= telegram_api::messages_editExportedChatInvite::REVOKED_MASK; } send_query(G()->net_query_creator().create(telegram_api::messages_editExportedChatInvite( - flags, false / *ignored* /, std::move(input_peer), invite_link, expire_date, usage_limit))); + flags, false /*ignored*/, std::move(input_peer), invite_link, expire_date, usage_limit))); } void on_result(uint64 id, BufferSlice packet) override { @@ -1661,7 +1657,7 @@ class EditChatInviteLinkQuery : public Td::ResultHandler { return on_error(id, result_ptr.move_as_error()); } - auto result = result_ptr.move_as_ok(); + auto result = move_tl_object_as(result_ptr.move_as_ok()); LOG(INFO) << "Receive result for ExportChatInviteQuery: " << to_string(result); td->contacts_manager_->on_get_users(std::move(result->users_), "EditChatInviteLinkQuery"); @@ -1697,11 +1693,9 @@ class GetExportedChatInvitesQuery : public Td::ResultHandler { } auto input_user = td->contacts_manager_->get_input_user(administrator_user_id); + CHECK(input_user != nullptr); int32 flags = 0; - if (input_user != nullptr) { - flags |= telegram_api::messages_getExportedChatInvites::ADMIN_ID_MASK; - } if (!offset_invite_link.empty() || offset_date != 0) { flags |= telegram_api::messages_getExportedChatInvites::OFFSET_DATE_MASK; flags |= telegram_api::messages_getExportedChatInvites::OFFSET_LINK_MASK; @@ -1710,7 +1704,7 @@ class GetExportedChatInvitesQuery : public Td::ResultHandler { flags |= telegram_api::messages_getExportedChatInvites::REVOKED_MASK; } send_query(G()->net_query_creator().create( - telegram_api::messages_getExportedChatInvites(flags, false / *ignored* /, std::move(input_peer), + telegram_api::messages_getExportedChatInvites(flags, false /*ignored*/, std::move(input_peer), std::move(input_user), offset_date, offset_invite_link, limit))); } @@ -1859,8 +1853,8 @@ class DeleteRevokedExportedChatInvitesQuery : public Td::ResultHandler { return on_error(0, Status::Error(400, "Can't access the chat")); } - send_query(G()->net_query_creator().create( - telegram_api::messages_deleteRevokedExportedChatInvites(std::move(input_peer)))); + send_query(G()->net_query_creator().create(telegram_api::messages_deleteRevokedExportedChatInvites( + std::move(input_peer), make_tl_object()))); } void on_result(uint64 id, BufferSlice packet) override { @@ -1877,7 +1871,7 @@ class DeleteRevokedExportedChatInvitesQuery : public Td::ResultHandler { promise_.set_error(std::move(status)); } }; -*/ + class CheckDialogInviteLinkQuery : public Td::ResultHandler { Promise promise_; string invite_link_; @@ -6881,7 +6875,7 @@ void ContactsManager::export_dialog_invite_link_impl(DialogId dialog_id, int32 e td_->create_handler(std::move(promise)) ->send(dialog_id, expire_date, usage_limit, is_permanent); } -/* + void ContactsManager::edit_dialog_invite_link(DialogId dialog_id, const string &invite_link, int32 expire_date, int32 usage_limit, bool is_revoked, Promise> &&promise) { @@ -6900,7 +6894,7 @@ void ContactsManager::get_dialog_invite_links(DialogId dialog_id, UserId adminis Promise> &&promise) { TRY_STATUS_PROMISE(promise, can_manage_dialog_invite_links(dialog_id)); - if (administrator_user_id != UserId() && !have_input_user(administrator_user_id)) { + if (!have_input_user(administrator_user_id)) { return promise.set_error(Status::Error(400, "Administrator user not found")); } @@ -6944,7 +6938,7 @@ void ContactsManager::delete_all_revoked_dialog_invite_links(DialogId dialog_id, td_->create_handler(std::move(promise))->send(dialog_id); } -*/ + void ContactsManager::check_dialog_invite_link(const string &invite_link, Promise &&promise) const { if (invite_link_infos_.count(invite_link) > 0) { return promise.set_value(Unit()); diff --git a/td/telegram/ContactsManager.h b/td/telegram/ContactsManager.h index 713d98c48..cca40271f 100644 --- a/td/telegram/ContactsManager.h +++ b/td/telegram/ContactsManager.h @@ -385,7 +385,7 @@ class ContactsManager : public Actor { void export_dialog_invite_link(DialogId dialog_id, int32 expire_date, int32 usage_limit, bool is_permanent, Promise> &&promise); - /* + void edit_dialog_invite_link(DialogId dialog_id, const string &link, int32 expire_date, int32 usage_limit, bool is_revoked, Promise> &&promise); @@ -400,7 +400,7 @@ class ContactsManager : public Actor { void delete_revoked_dialog_invite_link(DialogId dialog_id, const string &invite_link, Promise &&promise); void delete_all_revoked_dialog_invite_links(DialogId dialog_id, Promise &&promise); - */ + void check_dialog_invite_link(const string &invite_link, Promise &&promise) const; void import_dialog_invite_link(const string &invite_link, Promise &&promise); diff --git a/td/telegram/DialogParticipant.cpp b/td/telegram/DialogParticipant.cpp index 65ff4c06a..7bd29a4e8 100644 --- a/td/telegram/DialogParticipant.cpp +++ b/td/telegram/DialogParticipant.cpp @@ -171,7 +171,7 @@ tl_object_ptr DialogParticipantStatus::get_chat_a LOG(INFO) << "Create chat admin rights " << flags; return make_tl_object( flags, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, - false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/); + false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/); } tl_object_ptr DialogParticipantStatus::get_chat_banned_rights() const { diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 284a44299..3fccaf369 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -2805,16 +2805,19 @@ class SendMessageActor : public NetActorOnce { std::move(sent_message->entities_)); auto message_id = MessageId(ServerMessageId(sent_message->id_)); + auto ttl_period = (sent_message->flags_ & telegram_api::updateShortSentMessage::TTL_PERIOD_MASK) != 0 + ? sent_message->ttl_period_ + : 0; + auto update = make_tl_object(random_id_, message_id, sent_message->date_, ttl_period); if (dialog_id_.get_type() == DialogType::Channel) { - td->messages_manager_->add_pending_channel_update( - dialog_id_, make_tl_object(random_id_, message_id, sent_message->date_), - sent_message->pts_, sent_message->pts_count_, Promise(), "send message actor"); + td->messages_manager_->add_pending_channel_update(dialog_id_, std::move(update), sent_message->pts_, + sent_message->pts_count_, Promise(), + "send message actor"); return; } - td->updates_manager_->add_pending_pts_update( - make_tl_object(random_id_, message_id, sent_message->date_), sent_message->pts_, - sent_message->pts_count_, Promise(), "send message actor"); + td->updates_manager_->add_pending_pts_update(std::move(update), sent_message->pts_, sent_message->pts_count_, + Promise(), "send message actor"); } void on_error(uint64 id, Status status) override { @@ -4354,10 +4357,11 @@ class ReportPeerQuery : public Td::ResultHandler { if (message_ids.empty()) { send_query(G()->net_query_creator().create( - telegram_api::account_reportPeer(std::move(input_peer), std::move(report_reason)))); + telegram_api::account_reportPeer(std::move(input_peer), std::move(report_reason), string()))); } else { - send_query(G()->net_query_creator().create(telegram_api::messages_report( - std::move(input_peer), MessagesManager::get_server_message_ids(message_ids), std::move(report_reason)))); + send_query(G()->net_query_creator().create( + telegram_api::messages_report(std::move(input_peer), MessagesManager::get_server_message_ids(message_ids), + std::move(report_reason), string()))); } } @@ -6385,7 +6389,8 @@ void MessagesManager::skip_old_pending_pts_update(tl_object_ptrrandom_id_, update_sent_message->message_id_, - update_sent_message->date_, FileId(), "process old updateSentMessage"); + update_sent_message->date_, update_sent_message->ttl_period_, FileId(), + "process old updateSentMessage"); return; } else { LOG(ERROR) << "Receive awaited sent " << update_sent_message->message_id_ << " from " << source << " with pts " @@ -7241,7 +7246,8 @@ void MessagesManager::add_pending_channel_update(DialogId dialog_id, tl_object_p if (being_sent_messages_.count(update_sent_message->random_id_) > 0) { // apply sent channel message on_send_message_success(update_sent_message->random_id_, update_sent_message->message_id_, - update_sent_message->date_, FileId(), "process old updateSentChannelMessage"); + update_sent_message->date_, update_sent_message->ttl_period_, FileId(), + "process old updateSentChannelMessage"); promise.set_value(Unit()); return; } @@ -7314,10 +7320,11 @@ void MessagesManager::process_pts_update(tl_object_ptr &&u break; } case updateSentMessage::ID: { - auto send_message_success_update = move_tl_object_as(update); - LOG(INFO) << "Process updateSentMessage " << send_message_success_update->random_id_; - on_send_message_success(send_message_success_update->random_id_, send_message_success_update->message_id_, - send_message_success_update->date_, FileId(), "process updateSentMessage"); + auto update_sent_message = move_tl_object_as(update); + LOG(INFO) << "Process updateSentMessage " << update_sent_message->random_id_; + on_send_message_success(update_sent_message->random_id_, update_sent_message->message_id_, + update_sent_message->date_, update_sent_message->ttl_period_, FileId(), + "process updateSentMessage"); break; } case telegram_api::updateReadMessagesContents::ID: { @@ -7388,10 +7395,11 @@ void MessagesManager::process_channel_update(tl_object_ptr LOG(INFO) << "Process dummyUpdate"; break; case updateSentMessage::ID: { - auto send_message_success_update = move_tl_object_as(update); - LOG(INFO) << "Process updateSentMessage " << send_message_success_update->random_id_; - on_send_message_success(send_message_success_update->random_id_, send_message_success_update->message_id_, - send_message_success_update->date_, FileId(), "process updateSentChannelMessage"); + auto update_sent_message = move_tl_object_as(update); + LOG(INFO) << "Process updateSentMessage " << update_sent_message->random_id_; + on_send_message_success(update_sent_message->random_id_, update_sent_message->message_id_, + update_sent_message->date_, update_sent_message->ttl_period_, FileId(), + "process updateSentChannelMessage"); break; } case telegram_api::updateNewChannelMessage::ID: { @@ -8187,7 +8195,7 @@ void MessagesManager::report_dialog(DialogId dialog_id, const tl_object_ptr(text); + report_reason = make_tl_object(); break; } default: @@ -12607,7 +12615,7 @@ void MessagesManager::on_send_secret_message_success(int64 random_id, MessageId } } - on_send_message_success(random_id, message_id, date, new_file_id, "process send_secret_message_success"); + on_send_message_success(random_id, message_id, date, 0, new_file_id, "process send_secret_message_success"); } void MessagesManager::delete_secret_messages(SecretChatId secret_chat_id, std::vector random_ids, @@ -28453,7 +28461,7 @@ void MessagesManager::check_send_message_result(int64 random_id, DialogId dialog } FullMessageId MessagesManager::on_send_message_success(int64 random_id, MessageId new_message_id, int32 date, - FileId new_file_id, const char *source) { + int32 ttl_period, FileId new_file_id, const char *source) { CHECK(source != nullptr); // do not try to run getDifference from this function if (DROP_SEND_MESSAGE_UPDATES) { @@ -30876,7 +30884,7 @@ tl_object_ptr MessagesManager::get_ch return make_tl_object( flags, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, - false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/); + false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/); } int64 MessagesManager::get_dialog_event_log(DialogId dialog_id, const string &query, int64 from_event_id, int32 limit, diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index 37d9e973a..641a68c50 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -799,8 +799,8 @@ class MessagesManager : public Actor { void check_send_message_result(int64 random_id, DialogId dialog_id, const telegram_api::Updates *updates_ptr, const char *source); - FullMessageId on_send_message_success(int64 random_id, MessageId new_message_id, int32 date, FileId new_file_id, - const char *source); + FullMessageId on_send_message_success(int64 random_id, MessageId new_message_id, int32 date, int32 ttl_period, + FileId new_file_id, const char *source); void on_send_message_file_part_missing(int64 random_id, int bad_part); diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index e735c6b7b..ac9c5fc3a 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -6308,7 +6308,7 @@ void Td::on_request(uint64 id, const td_api::replacePermanentChatInviteLink &req CREATE_REQUEST_PROMISE(); contacts_manager_->export_dialog_invite_link(DialogId(request.chat_id_), 0, 0, true, std::move(promise)); } -/* + void Td::on_request(uint64 id, const td_api::createChatInviteLink &request) { CREATE_REQUEST_PROMISE(); contacts_manager_->export_dialog_invite_link(DialogId(request.chat_id_), request.expire_date_, request.member_limit_, @@ -6356,7 +6356,7 @@ void Td::on_request(uint64 id, const td_api::deleteAllRevokedChatInviteLinks &re CREATE_OK_REQUEST_PROMISE(); contacts_manager_->delete_all_revoked_dialog_invite_links(DialogId(request.chat_id_), std::move(promise)); } -*/ + void Td::on_request(uint64 id, td_api::checkChatInviteLink &request) { CHECK_IS_USER(); CLEAN_INPUT_STRING(request.invite_link_); diff --git a/td/telegram/Td.h b/td/telegram/Td.h index d46ca943f..789112c81 100644 --- a/td/telegram/Td.h +++ b/td/telegram/Td.h @@ -793,7 +793,7 @@ class Td final : public NetQueryCallback { void on_request(uint64 id, td_api::getChatAdministrators &request); void on_request(uint64 id, const td_api::replacePermanentChatInviteLink &request); - /* + void on_request(uint64 id, const td_api::createChatInviteLink &request); void on_request(uint64 id, td_api::editChatInviteLink &request); @@ -807,7 +807,7 @@ class Td final : public NetQueryCallback { void on_request(uint64 id, td_api::deleteRevokedChatInviteLink &request); void on_request(uint64 id, const td_api::deleteAllRevokedChatInviteLinks &request); - */ + void on_request(uint64 id, td_api::checkChatInviteLink &request); void on_request(uint64 id, td_api::joinChatByInviteLink &request); diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index 1dbd0d80e..a68797ee3 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -788,7 +788,8 @@ void UpdatesManager::on_get_updates(tl_object_ptr &&updat false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, update->id_, make_tl_object(from_id), make_tl_object(update->user_id_), std::move(update->fwd_from_), update->via_bot_id_, std::move(update->reply_to_), update->date_, - update->message_, nullptr, nullptr, std::move(update->entities_), 0, 0, nullptr, 0, string(), 0, Auto()); + update->message_, nullptr, nullptr, std::move(update->entities_), 0, 0, nullptr, 0, string(), 0, Auto(), + update->ttl_period_); on_pending_update( make_tl_object(std::move(message), update->pts_, update->pts_count_), 0, std::move(promise), "telegram_api::updatesShortMessage"); @@ -812,7 +813,7 @@ void UpdatesManager::on_get_updates(tl_object_ptr &&updat make_tl_object(update->from_id_), make_tl_object(update->chat_id_), std::move(update->fwd_from_), update->via_bot_id_, std::move(update->reply_to_), update->date_, update->message_, nullptr, nullptr, std::move(update->entities_), - 0, 0, nullptr, 0, string(), 0, Auto()); + 0, 0, nullptr, 0, string(), 0, Auto(), update->ttl_period_); on_pending_update( make_tl_object(std::move(message), update->pts_, update->pts_count_), 0, std::move(promise), "telegram_api::updatesShortChatMessage"); @@ -2845,8 +2846,20 @@ void UpdatesManager::on_update(tl_object_ptr update, Promise &&promise) { + promise.set_value(Unit()); +} + +void UpdatesManager::on_update(tl_object_ptr update, Promise &&promise) { + promise.set_value(Unit()); +} + void UpdatesManager::on_update(tl_object_ptr update, Promise &&promise) { promise.set_value(Unit()); } +void UpdatesManager::on_update(tl_object_ptr update, Promise &&promise) { + promise.set_value(Unit()); +} + } // namespace td diff --git a/td/telegram/UpdatesManager.h b/td/telegram/UpdatesManager.h index 945e36d53..0ee5d820f 100644 --- a/td/telegram/UpdatesManager.h +++ b/td/telegram/UpdatesManager.h @@ -59,9 +59,10 @@ class updateSentMessage : public telegram_api::Update { int64 random_id_; MessageId message_id_; int32 date_; + int32 ttl_period_; - updateSentMessage(int64 random_id, MessageId message_id, int32 date) - : random_id_(random_id), message_id_(message_id), date_(date) { + updateSentMessage(int64 random_id, MessageId message_id, int32 date, int32 ttl_period) + : random_id_(random_id), message_id_(message_id), date_(date), ttl_period_(ttl_period) { } static constexpr int32 ID = 1234567890; @@ -82,6 +83,7 @@ class updateSentMessage : public telegram_api::Update { s.store_field("random_id", random_id_); s.store_field("message_id", message_id_.get()); s.store_field("date", date_); + s.store_field("ttl_period", ttl_period_); s.store_class_end(); } }; @@ -452,7 +454,13 @@ class UpdatesManager : public Actor { // unsupported updates + void on_update(tl_object_ptr update, Promise &&promise); + + void on_update(tl_object_ptr update, Promise &&promise); + void on_update(tl_object_ptr update, Promise &&promise); + + void on_update(tl_object_ptr update, Promise &&promise); }; } // namespace td diff --git a/td/telegram/Version.h b/td/telegram/Version.h index af435abeb..11d98bf11 100644 --- a/td/telegram/Version.h +++ b/td/telegram/Version.h @@ -8,7 +8,7 @@ namespace td { -constexpr int32 MTPROTO_LAYER = 123; +constexpr int32 MTPROTO_LAYER = 124; enum class Version : int32 { Initial, // 0 diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 6d7c4c258..7321d6a21 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -2696,7 +2696,6 @@ class CliClient final : public Actor { } else if (op == "rpcil") { string chat_id = args; send_request(td_api::make_object(as_chat_id(chat_id))); - /* } else if (op == "ccilt") { string chat_id; int32 expire_date; @@ -2744,7 +2743,6 @@ class CliClient final : public Actor { } else if (op == "darcil") { string chat_id = args; send_request(td_api::make_object(as_chat_id(chat_id))); - */ } else if (op == "ccil") { send_request(td_api::make_object(args)); } else if (op == "jcbil") {