From 549789bfb76d2e517c26281d28069850ffc7cda2 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 8 Aug 2019 11:15:59 +0100 Subject: [PATCH] Update API scheme to layer 105. --- Telegram/Resources/tl/api.tl | 55 ++++++++++++---- Telegram/SourceFiles/api/api_sending.cpp | 3 +- Telegram/SourceFiles/apiwrap.cpp | 43 ++++++++---- .../SourceFiles/boxes/edit_caption_box.cpp | 3 +- .../boxes/peer_list_controllers.cpp | 3 +- Telegram/SourceFiles/data/data_session.cpp | 65 ++++++++++--------- .../admin_log/history_admin_log_item.cpp | 8 ++- .../SourceFiles/history/history_message.cpp | 14 ++-- .../SourceFiles/history/history_widget.cpp | 15 +++-- .../inline_bots/inline_bot_send_data.cpp | 4 +- Telegram/SourceFiles/main/main_account.cpp | 2 +- .../settings/settings_privacy_controllers.cpp | 4 +- .../support/support_autocomplete.cpp | 4 +- 13 files changed, 145 insertions(+), 78 deletions(-) diff --git a/Telegram/Resources/tl/api.tl b/Telegram/Resources/tl/api.tl index 945b3893b..52230892c 100644 --- a/Telegram/Resources/tl/api.tl +++ b/Telegram/Resources/tl/api.tl @@ -108,7 +108,7 @@ storage.fileMp4#b3cea0e4 = storage.FileType; storage.fileWebp#1081464c = storage.FileType; userEmpty#200250ba id:int = User; -user#2e13f4c3 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?string bot_inline_placeholder:flags.19?string lang_code:flags.22?string = 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; @@ -123,11 +123,11 @@ userStatusLastMonth#77ebc742 = UserStatus; chatEmpty#9ba2d800 id:int = Chat; chat#3bda1bde flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true deactivated:flags.5?true id:int title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat; chatForbidden#7328bdb id:int title:string = Chat; -channel#4df30834 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 id:int access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?string 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 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#1b7c9db3 flags:# can_set_username:flags.7?true id:int about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int = ChatFull; -channelFull#2d895c74 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_view_stats:flags.12?true can_set_location:flags.16?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: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 pts:int = ChatFull; +chatFull#1b7c9db3 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:ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int = ChatFull; +channelFull#2d895c74 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_view_stats:flags.12?true can_set_location:flags.16?true has_scheduled:flags.19?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: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 pts:int = ChatFull; chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant; chatParticipantCreator#da13538a user_id:int = ChatParticipant; @@ -140,7 +140,7 @@ chatPhotoEmpty#37c1011c = ChatPhoto; chatPhoto#475cdbd5 photo_small:FileLocation photo_big:FileLocation dc_id:int = ChatPhoto; messageEmpty#83e5de54 id:int = Message; -message#44f9b43d 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 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 = 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; messageService#9e19a1f6 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?int to_id:Peer reply_to_msg_id:flags.3?int date:int action:MessageAction = Message; messageMediaEmpty#3ded6320 = MessageMedia; @@ -222,7 +222,7 @@ inputReportReasonOther#e1746d0a text:string = ReportReason; inputReportReasonCopyright#9b89f93a = ReportReason; inputReportReasonGeoIrrelevant#dbd4feed = 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 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#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 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; contact#f911c994 user_id:int mutual:Bool = Contact; @@ -344,6 +344,9 @@ updateChatDefaultBannedRights#54c01850 peer:Peer default_banned_rights:ChatBanne updateFolderPeers#19360dc0 folder_peers:Vector pts:int pts_count:int = Update; updatePeerSettings#6a7e7366 peer:Peer settings:PeerSettings = Update; updatePeerLocated#b4afcfb0 peers:Vector = Update; +updateNewScheduledMessage#39a51dfb message:Message = Update; +updateDeleteScheduledMessages#90866cee peer:Peer messages:Vector = Update; +updateTheme#8216fba3 theme:Theme = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -440,6 +443,7 @@ inputPrivacyKeyPhoneP2P#db9e70d2 = InputPrivacyKey; inputPrivacyKeyForwards#a4dd4c08 = InputPrivacyKey; inputPrivacyKeyProfilePhoto#5719bacc = InputPrivacyKey; inputPrivacyKeyPhoneNumber#352dafa = InputPrivacyKey; +inputPrivacyKeyAddedByPhone#d1219bdd = InputPrivacyKey; privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey; privacyKeyChatInvite#500e6dfa = PrivacyKey; @@ -448,6 +452,7 @@ privacyKeyPhoneP2P#39491cc8 = PrivacyKey; privacyKeyForwards#69ec56a3 = PrivacyKey; privacyKeyProfilePhoto#96151fed = PrivacyKey; privacyKeyPhoneNumber#d19ae46d = PrivacyKey; +privacyKeyAddedByPhone#42ffd42b = PrivacyKey; inputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule; inputPrivacyValueAllowAll#184b35ce = InputPrivacyRule; @@ -491,7 +496,7 @@ messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMess webPageEmpty#eb1477e8 id:long = WebPage; webPagePending#c586da1c id:long date:int = WebPage; -webPage#5f07b4bc flags:# id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page = WebPage; +webPage#fa64e172 flags:# id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document documents:flags.11?Vector cached_page:flags.10?Page = WebPage; webPageNotModified#85849473 = WebPage; authorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true hash:long device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization; @@ -1062,6 +1067,17 @@ channelLocation#209b82db geo_point:GeoPoint address:string = ChannelLocation; peerLocated#ca461b5d peer:Peer expires:int distance:int = PeerLocated; +restrictionReason#d072acb4 platform:string reason:string text:string = RestrictionReason; + +inputTheme#3c5693e9 id:long access_hash:long = InputTheme; +inputThemeSlug#f5890df1 slug:string = InputTheme; + +themeDocumentNotModified#483d270c = Theme; +theme#574e4de9 flags:# creator:flags.0?true default:flags.1?true id:long access_hash:long slug:string title:string document:Document = Theme; + +account.themesNotModified#f41eb622 = account.Themes; +account.themes#7f676421 hash:int themes:Vector = account.Themes; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -1143,6 +1159,13 @@ account.installWallPaper#feed5769 wallpaper:InputWallPaper settings:WallPaperSet account.resetWallPapers#bb3b9804 = Bool; account.getAutoDownloadSettings#56da0b3f = account.AutoDownloadSettings; account.saveAutoDownloadSettings#76f36233 flags:# low:flags.0?true high:flags.1?true settings:AutoDownloadSettings = Bool; +account.uploadTheme#1c3db333 flags:# file:InputFile thumb:flags.0?InputFile file_name:string mime_type:string = Document; +account.createTheme#2b7ffd7f slug:string title:string document:InputDocument = Theme; +account.updateTheme#f8997176 flags:# theme:InputTheme slug:flags.0?string title:flags.1?string document:flags.2?InputDocument = Theme; +account.saveTheme#f257106c theme:InputTheme unsave:Bool = Bool; +account.installTheme#e0f8439c format:string theme:InputTheme = Bool; +account.getTheme#8d9d742b format:string theme:InputTheme document_id:long = Theme; +account.getThemes#285946f8 format:string hash:int = account.Themes; users.getUsers#d91a548 id:Vector = Vector; users.getFullUser#ca30a5b1 id:InputUser = UserFull; @@ -1177,9 +1200,9 @@ messages.deleteHistory#1c015b09 flags:# just_clear:flags.0?true revoke:flags.1?t messages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector = messages.AffectedMessages; messages.receivedMessages#5a954c0 max_id:int = Vector; messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool; -messages.sendMessage#fa88427a flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector = Updates; -messages.sendMedia#b8d1262b flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector = Updates; -messages.forwardMessages#708e0195 flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true grouped:flags.9?true from_peer:InputPeer id:Vector random_id:Vector to_peer:InputPeer = Updates; +messages.sendMessage#520c3870 flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int = Updates; +messages.sendMedia#3491eba9 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int = Updates; +messages.forwardMessages#d9fee60e flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true grouped:flags.9?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; @@ -1223,9 +1246,9 @@ 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; messages.setInlineBotResults#eb5ea206 flags:# gallery:flags.0?true private:flags.1?true query_id:long results:Vector cache_time:int next_offset:flags.2?string switch_pm:flags.3?InlineBotSwitchPM = Bool; -messages.sendInlineBotResult#b16e06fe flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string = Updates; +messages.sendInlineBotResult#220815b0 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string schedule_date:flags.10?int = Updates; messages.getMessageEditData#fda68d36 peer:InputPeer id:int = messages.MessageEditData; -messages.editMessage#d116f31e flags:# no_webpage:flags.1?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector = Updates; +messages.editMessage#48f71778 flags:# no_webpage:flags.1?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.15?int = Updates; messages.editInlineBotMessage#83557dba flags:# no_webpage:flags.1?true id:InputBotInlineMessageID message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector = Bool; messages.getBotCallbackAnswer#810a9fec flags:# game:flags.1?true peer:InputPeer msg_id:int data:flags.0?bytes = messages.BotCallbackAnswer; messages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long message:flags.0?string url:flags.2?string cache_time:int = Bool; @@ -1259,7 +1282,7 @@ messages.faveSticker#b9ffc55b id:InputDocument unfave:Bool = Bool; messages.getUnreadMentions#46578472 peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages; messages.readMentions#f0189d3 peer:InputPeer = messages.AffectedHistory; messages.getRecentLocations#bbc45b09 peer:InputPeer limit:int hash:int = messages.Messages; -messages.sendMultiMedia#2095512f flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int multi_media:Vector = Updates; +messages.sendMultiMedia#cc0110cb flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int multi_media:Vector schedule_date:flags.10?int = Updates; messages.uploadEncryptedFile#5057c497 peer:InputEncryptedChat file:InputEncryptedFile = EncryptedFile; messages.searchStickerSets#c2b7d08b flags:# exclude_featured:flags.0?true q:string hash:int = messages.FoundStickerSets; messages.getSplitRanges#1cff7e08 = Vector; @@ -1281,6 +1304,10 @@ messages.getSearchCounters#732eef00 peer:InputPeer filters:Vector = messages.Messages; +messages.sendScheduledMessages#bd38850a peer:InputPeer id:Vector = Updates; +messages.deleteScheduledMessages#59ae2b16 peer:InputPeer id:Vector = Updates; updates.getState#edd4882a = updates.State; updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference; @@ -1388,4 +1415,4 @@ langpack.getLanguage#6a596502 lang_pack:string lang_code:string = LangPackLangua folders.editPeerFolders#6847d0ab folder_peers:Vector = Updates; folders.deleteFolder#1c295881 folder_id:int = Updates; -// LAYER 104 +// LAYER 105 diff --git a/Telegram/SourceFiles/api/api_sending.cpp b/Telegram/SourceFiles/api/api_sending.cpp index 86e958a4a..02124e6ca 100644 --- a/Telegram/SourceFiles/api/api_sending.cpp +++ b/Telegram/SourceFiles/api/api_sending.cpp @@ -111,7 +111,8 @@ void SendExistingMedia( MTP_string(captionText), MTP_long(randomId), MTPReplyMarkup(), - sentEntities + sentEntities, + MTP_int(0) // schedule_date )).done([=](const MTPUpdates &result) { api->applyUpdates(result, randomId); }).fail([=](const RPCError &error) { diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 3a3fab77d..b4a7a09c7 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -3553,7 +3553,8 @@ void ApiWrap::applyUpdatesNoPtsCheck(const MTPUpdates &updates) { switch (updates.type()) { case mtpc_updateShortMessage: { const auto &d = updates.c_updateShortMessage(); - const auto flags = mtpCastFlags(d.vflags().v) | MTPDmessage::Flag::f_from_id; + const auto flags = mtpCastFlags(d.vflags().v) + | MTPDmessage::Flag::f_from_id; const auto peerUserId = d.is_out() ? d.vuser_id() : MTP_int(_session->userId()); @@ -3575,7 +3576,9 @@ void ApiWrap::applyUpdatesNoPtsCheck(const MTPUpdates &updates) { MTPint(), MTPint(), MTPstring(), - MTPlong()), + MTPlong(), + //MTPMessageReactions(), + MTPVector()), MTPDmessage_ClientFlags(), NewMessageType::Unread); } break; @@ -3601,7 +3604,9 @@ void ApiWrap::applyUpdatesNoPtsCheck(const MTPUpdates &updates) { MTPint(), MTPint(), MTPstring(), - MTPlong()), + MTPlong(), + //MTPMessageReactions(), + MTPVector()), MTPDmessage_ClientFlags(), NewMessageType::Unread); } break; @@ -4450,7 +4455,8 @@ void ApiWrap::forwardMessages( forwardFrom->input, MTP_vector(ids), MTP_vector(randomIds), - peer->input + peer->input, + MTP_int(0) // schedule_date )).done([=, callback = std::move(successCallback)]( const MTPUpdates &updates) { applyUpdates(updates); @@ -4601,7 +4607,9 @@ void ApiWrap::sendSharedContact( MTP_int(views), MTPint(), MTP_string(messagePostAuthor), - MTPlong()), + MTPlong(), + //MTPMessageReactions(), + MTPVector()), clientFlags, NewMessageType::Unread); @@ -4846,7 +4854,8 @@ void ApiWrap::editUploadedFile( MTP_string(item->originalText().text), *media, MTPReplyMarkup(), - sentEntities + sentEntities, + MTP_int(0) // schedule_date )).done([=](const MTPUpdates &result) { item->clearSavedMedia(); item->setIsLocalUpdateMedia(true); @@ -4982,7 +4991,9 @@ void ApiWrap::sendMessage(MessageToSend &&message) { MTP_int(1), MTPint(), MTP_string(messagePostAuthor), - MTPlong()), + MTPlong(), + //MTPMessageReactions(), + MTPVector()), clientFlags, NewMessageType::Unread); history->sendRequestId = request(MTPmessages_SendMessage( @@ -4992,7 +5003,8 @@ void ApiWrap::sendMessage(MessageToSend &&message) { msgText, MTP_long(randomId), MTPReplyMarkup(), - sentEntities + sentEntities, + MTP_int(0) // schedule_date )).done([=](const MTPUpdates &result) { applyUpdates(result, randomId); history->clearSentDraftText(QString()); @@ -5111,7 +5123,8 @@ void ApiWrap::sendInlineResult( MTP_int(options.replyTo), MTP_long(randomId), MTP_long(data->getQueryId()), - MTP_string(data->getId()) + MTP_string(data->getId()), + MTP_int(0) // schedule_date )).done([=](const MTPUpdates &result) { applyUpdates(result, randomId); history->clearSentDraftText(QString()); @@ -5246,7 +5259,8 @@ void ApiWrap::sendMediaWithRandomId( MTP_string(caption.text), MTP_long(randomId), MTPReplyMarkup(), - sentEntities + sentEntities, + MTP_int(0) // schedule_date )).done([=](const MTPUpdates &result) { applyUpdates(result); }).fail([=](const RPCError &error) { @@ -5333,7 +5347,8 @@ void ApiWrap::sendAlbumIfReady(not_null album) { MTP_flags(flags), peer->input, MTP_int(replyTo), - MTP_vector(medias) + MTP_vector(medias), + MTP_int(0) // schedule_date )).done([=](const MTPUpdates &result) { _sendingAlbums.remove(groupId); applyUpdates(result); @@ -5819,7 +5834,8 @@ void ApiWrap::createPoll( MTP_string(), MTP_long(rand_value()), MTPReplyMarkup(), - MTPVector() + MTPVector(), + MTP_int(0) // schedule_date )).done([=, done = std::move(done)](const MTPUpdates &result) mutable { applyUpdates(result); done(); @@ -5895,7 +5911,8 @@ void ApiWrap::closePoll(not_null item) { MTPstring(), MTP_inputMediaPoll(PollDataToMTP(poll)), MTPReplyMarkup(), - MTPVector() + MTPVector(), + MTP_int(0) // schedule_date )).done([=](const MTPUpdates &result) { _pollCloseRequestIds.erase(itemId); applyUpdates(result); diff --git a/Telegram/SourceFiles/boxes/edit_caption_box.cpp b/Telegram/SourceFiles/boxes/edit_caption_box.cpp index 96543ca7f..3a18bfac9 100644 --- a/Telegram/SourceFiles/boxes/edit_caption_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_caption_box.cpp @@ -934,7 +934,8 @@ void EditCaptionBox::save() { MTP_string(sending.text), MTPInputMedia(), MTPReplyMarkup(), - sentEntities), + sentEntities, + MTP_int(0)), // schedule_date rpcDone(&EditCaptionBox::saveDone), rpcFail(&EditCaptionBox::saveFail)); } diff --git a/Telegram/SourceFiles/boxes/peer_list_controllers.cpp b/Telegram/SourceFiles/boxes/peer_list_controllers.cpp index 5d5e2ddc2..28b64dc4d 100644 --- a/Telegram/SourceFiles/boxes/peer_list_controllers.cpp +++ b/Telegram/SourceFiles/boxes/peer_list_controllers.cpp @@ -42,7 +42,8 @@ void ShareBotGame(not_null bot, not_null chat) { MTP_string(), MTP_long(randomId), MTPReplyMarkup(), - MTPVector() + MTPVector(), + MTP_int(0) // schedule_date )).done([=](const MTPUpdates &result) { api->applyUpdates(result, randomId); }).fail([=](const RPCError &error) { diff --git a/Telegram/SourceFiles/data/data_session.cpp b/Telegram/SourceFiles/data/data_session.cpp index 6f0613f67..f5dde4767 100644 --- a/Telegram/SourceFiles/data/data_session.cpp +++ b/Telegram/SourceFiles/data/data_session.cpp @@ -95,27 +95,28 @@ void CheckForSwitchInlineButton(not_null item) { // We should get a full restriction in "{full}: {reason}" format and we // need to find an "-all" tag in {full}, otherwise ignore this restriction. -QString ExtractUnavailableReason(const QString &restriction) { - const auto fullEnd = restriction.indexOf(':'); - if (fullEnd <= 0) { - return QString(); - } - - // {full} is in "{type}-{tag}-{tag}-{tag}" format - // if we find "all" tag we return the restriction string - const auto typeTags = restriction.mid(0, fullEnd).split('-').mid(1); -#ifdef OS_MAC_STORE - const auto restrictionApplies = typeTags.contains(qsl("all")) - || typeTags.contains(qsl("ios")); -#elif defined OS_WIN_STORE // OS_MAC_STORE - const auto restrictionApplies = typeTags.contains(qsl("all")) - || typeTags.contains(qsl("ms")); -#else - const auto restrictionApplies = typeTags.contains(qsl("all")); -#endif // OS_MAC_STORE || OS_WIN_STORE - if (restrictionApplies) { - return restriction.midRef(fullEnd + 1).trimmed().toString(); - } +QString ExtractUnavailableReason( + const QVector &restriction) { +// const auto fullEnd = restriction.indexOf(':'); +// if (fullEnd <= 0) { +// return QString(); +// } +// +// // {full} is in "{type}-{tag}-{tag}-{tag}" format +// // if we find "all" tag we return the restriction string +// const auto typeTags = restriction.mid(0, fullEnd).split('-').mid(1); +//#ifdef OS_MAC_STORE +// const auto restrictionApplies = typeTags.contains(qsl("all")) +// || typeTags.contains(qsl("ios")); +//#elif defined OS_WIN_STORE // OS_MAC_STORE +// const auto restrictionApplies = typeTags.contains(qsl("all")) +// || typeTags.contains(qsl("ms")); +//#else +// const auto restrictionApplies = typeTags.contains(qsl("all")); +//#endif // OS_MAC_STORE || OS_WIN_STORE +// if (restrictionApplies) { +// return restriction.midRef(fullEnd + 1).trimmed().toString(); +// } return QString(); } @@ -355,7 +356,7 @@ not_null Session::processUser(const MTPUser &data) { } if (const auto restriction = data.vrestriction_reason()) { result->setUnavailableReason( - ExtractUnavailableReason(qs(*restriction))); + ExtractUnavailableReason(restriction->v)); } else { result->setUnavailableReason(QString()); } @@ -626,7 +627,7 @@ not_null Session::processChat(const MTPChat &data) { } if (const auto restriction = data.vrestriction_reason()) { channel->setUnavailableReason( - ExtractUnavailableReason(qs(*restriction))); + ExtractUnavailableReason(restriction->v)); } else { channel->setUnavailableReason(QString()); } @@ -3585,17 +3586,17 @@ void Session::serviceNotification( | MTPDuser::Flag::f_status | MTPDuser::Flag::f_verified), MTP_int(peerToUser(PeerData::kServiceNotificationsId)), - MTPlong(), + MTPlong(), // access_hash MTP_string("Telegram"), - MTPstring(), - MTPstring(), + MTPstring(), // last_name + MTPstring(), // username MTP_string("42777"), MTP_userProfilePhotoEmpty(), MTP_userStatusRecently(), - MTPint(), - MTPstring(), - MTPstring(), - MTPstring())); + MTPint(), // bot_info_version + MTPVector(), + MTPstring(), // bot_inline_placeholder + MTPstring())); // lang_code } const auto history = this->history(PeerData::kServiceNotificationsId); if (!history->folderKnown()) { @@ -3643,7 +3644,9 @@ void Session::insertCheckedServiceNotification( MTPint(), MTPint(), MTPstring(), - MTPlong()), + MTPlong(), + //MTPMessageReactions(), + MTPVector()), clientFlags, NewMessageType::Unread); } diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp index 38ea0684c..e4c7c466d 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp @@ -68,7 +68,9 @@ MTPMessage PrepareLogMessage( | MTPDmessage::Flag::f_post | MTPDmessage::Flag::f_reply_to_msg_id | MTPDmessage::Flag::f_edit_date - | MTPDmessage::Flag::f_grouped_id; + | MTPDmessage::Flag::f_grouped_id + //| MTPDmessage::Flag::f_reactions + | MTPDmessage::Flag::f_restriction_reason; const auto flags = message.vflags().v & ~removeFlags; const auto fwdFrom = message.vfwd_from(); const auto media = message.vmedia(); @@ -90,7 +92,9 @@ MTPMessage PrepareLogMessage( MTP_int(message.vviews().value_or_empty()), MTP_int(0), // edit_date MTP_string(), - MTP_long(0)); // grouped_id + MTP_long(0), // grouped_id + //MTPMessageReactions(), + MTPVector()); }); } diff --git a/Telegram/SourceFiles/history/history_message.cpp b/Telegram/SourceFiles/history/history_message.cpp index 6b3865a6d..ecca72575 100644 --- a/Telegram/SourceFiles/history/history_message.cpp +++ b/Telegram/SourceFiles/history/history_message.cpp @@ -295,14 +295,14 @@ void FastShareMessage(not_null item) { message.clearDraft = false; history->session().api().sendMessage(std::move(message)); } - auto request = MTPmessages_ForwardMessages( - MTP_flags(sendFlags), - data->peer->input, - MTP_vector(msgIds), - MTP_vector(generateRandom()), - peer->input); history->sendRequestId = MTP::send( - request, + MTPmessages_ForwardMessages( + MTP_flags(sendFlags), + data->peer->input, + MTP_vector(msgIds), + MTP_vector(generateRandom()), + peer->input, + MTP_int(0)), rpcDone(base::duplicate(doneCallback)), nullptr, 0, diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 7263e7aa0..f031ce37a 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -2777,7 +2777,8 @@ void HistoryWidget::saveEditMsg() { MTP_string(sending.text), MTPInputMedia(), MTPReplyMarkup(), - sentEntities), + sentEntities, + MTP_int(0)), // schedule_date rpcDone(&HistoryWidget::saveEditMsgDone, _history), rpcFail(&HistoryWidget::saveEditMsgFail, _history)); } @@ -4414,7 +4415,9 @@ void HistoryWidget::sendFileConfirmed( MTP_int(1), MTPint(), MTP_string(messagePostAuthor), - MTP_long(groupId)); + MTP_long(groupId), + //MTPMessageReactions(), + MTPVector()); if (itemToEdit) { itemToEdit->savePreviousMedia(); @@ -4448,7 +4451,9 @@ void HistoryWidget::sendFileConfirmed( MTP_int(1), MTPint(), MTP_string(messagePostAuthor), - MTP_long(groupId)); + MTP_long(groupId), + //MTPMessageReactions(), + MTPVector()); if (itemToEdit) { itemToEdit->savePreviousMedia(); @@ -4485,7 +4490,9 @@ void HistoryWidget::sendFileConfirmed( MTP_int(1), MTPint(), MTP_string(messagePostAuthor), - MTP_long(groupId)), + MTP_long(groupId), + //MTPMessageReactions(), + MTPVector()), clientFlags, NewMessageType::Unread); // Voices can't be edited. diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_send_data.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_send_data.cpp index ee6ccbe31..22dfaea18 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_send_data.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_bot_send_data.cpp @@ -58,7 +58,9 @@ void SendDataCommon::addToHistory( MTP_int(1), MTPint(), MTP_string(postAuthor), - MTPlong()), + MTPlong(), + //MTPMessageReactions(), + MTPVector()), clientFlags, NewMessageType::Unread); } diff --git a/Telegram/SourceFiles/main/main_account.cpp b/Telegram/SourceFiles/main/main_account.cpp index 67930a1c4..434d20fc4 100644 --- a/Telegram/SourceFiles/main/main_account.cpp +++ b/Telegram/SourceFiles/main/main_account.cpp @@ -335,7 +335,7 @@ void Account::startMtp() { MTPUserProfilePhoto(), MTPUserStatus(), MTPint(), // bot_info_version - MTPstring(), // restriction_reason + MTPVector(), MTPstring(), // bot_inline_placeholder MTPstring())); // lang_code Local::readSelf( diff --git a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp index baac11f38..0db326282 100644 --- a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp +++ b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp @@ -158,7 +158,9 @@ AdminLog::OwnedItem GenerateForwardedItem( MTPint(), // views MTPint(), // edit_date MTPstring(), // post_author - MTPlong() // grouped_id + MTPlong(), // grouped_id + //MTPMessageReactions(), + MTPVector() ).match([&](const MTPDmessage &data) { return history->owner().makeMessage( history, diff --git a/Telegram/SourceFiles/support/support_autocomplete.cpp b/Telegram/SourceFiles/support/support_autocomplete.cpp index dafc64ed5..aad439927 100644 --- a/Telegram/SourceFiles/support/support_autocomplete.cpp +++ b/Telegram/SourceFiles/support/support_autocomplete.cpp @@ -318,7 +318,9 @@ AdminLog::OwnedItem GenerateContactItem( MTP_int(0), MTP_int(0), MTP_string(), - MTP_long(0)); + MTP_long(0), + //MTPMessageReactions(), + MTPVector()); const auto item = history->owner().makeMessage( history, message.c_message(),