diff --git a/Telegram/Resources/tl/api.tl b/Telegram/Resources/tl/api.tl index 8b77c3a46..01abd6f35 100644 --- a/Telegram/Resources/tl/api.tl +++ b/Telegram/Resources/tl/api.tl @@ -110,7 +110,7 @@ storage.fileMp4#b3cea0e4 = storage.FileType; storage.fileWebp#1081464c = storage.FileType; userEmpty#d3bc4b7a id:long = User; -user#5d99adee 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 apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true id:long 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 emoji_status:flags.30?EmojiStatus = User; +user#8f97c628 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 apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# id:long 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 emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector = User; userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto; userProfilePhoto#82d1f706 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto; @@ -125,7 +125,7 @@ userStatusLastMonth#77ebc742 = UserStatus; chatEmpty#29562865 id:long = Chat; chat#41cbf256 flags:# creator:flags.0?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?true noforwards:flags.25?true id:long 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#6592a1a7 id:long title:string = Chat; -channel#8261ac61 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 noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date: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; +channel#83259464 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 noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date: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 usernames:flags2.0?Vector = Chat; channelForbidden#17d493d5 flags:# broadcast:flags.5?true megagroup:flags.8?true id:long access_hash:long title:string until_date:flags.16?int = Chat; chatFull#c9d31138 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:long 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 groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string requests_pending:flags.17?int recent_requesters:flags.17?Vector available_reactions:flags.18?ChatReactions = ChatFull; @@ -352,7 +352,7 @@ updatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update; updateLangPackTooLong#46560264 lang_code:string = Update; updateLangPack#56022f4d difference:LangPackDifference = Update; updateFavedStickers#e511996d = Update; -updateChannelReadMessagesContents#44bdd535 channel_id:long messages:Vector = Update; +updateChannelReadMessagesContents#ea29055d flags:# channel_id:long top_msg_id:flags.0?int messages:Vector = Update; updateContactsReset#7084a7be = Update; updateChannelAvailableMessages#b23fc698 channel_id:long available_min_id:int = Update; updateDialogUnreadMark#e16459c3 flags:# unread:flags.0?true peer:DialogPeer = Update; @@ -1453,7 +1453,9 @@ messageExtendedMedia#ee479c64 media:MessageMedia = MessageExtendedMedia; stickerKeyword#fcfeb29c document_id:long keyword:Vector = StickerKeyword; -forumTopic#7068973b flags:# id:int date:int title:string icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int = ForumTopic; +username#b4073647 flags:# editable:flags.0?true active:flags.1?true username:string = Username; + +forumTopic#2f3e1a06 flags:# id:int date:int title:string icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int = ForumTopic; messages.forumTopics#367617d3 flags:# order_by_create_date:flags.0?true count:int topics:Vector messages:Vector chats:Vector users:Vector pts:int = messages.ForumTopics; @@ -1547,7 +1549,7 @@ account.createTheme#652e4400 flags:# slug:string title:string document:flags.2?I account.updateTheme#2bf40ccc flags:# format:string theme:InputTheme slug:flags.0?string title:flags.1?string document:flags.2?InputDocument settings:flags.3?Vector = Theme; account.saveTheme#f257106c theme:InputTheme unsave:Bool = Bool; account.installTheme#c727bb3b flags:# dark:flags.0?true theme:flags.1?InputTheme format:flags.2?string base_theme:flags.3?BaseTheme = Bool; -account.getTheme#8d9d742b format:string theme:InputTheme document_id:long = Theme; +account.getTheme#3a5869ec format:string theme:InputTheme = Theme; account.getThemes#7206e458 format:string hash:long = account.Themes; account.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool; account.getContentSettings#8b9b4dae = account.ContentSettings; @@ -1567,6 +1569,8 @@ account.updateEmojiStatus#fbd3de6b emoji_status:EmojiStatus = Bool; account.getDefaultEmojiStatuses#d6753386 hash:long = account.EmojiStatuses; account.getRecentEmojiStatuses#f578105 hash:long = account.EmojiStatuses; account.clearRecentEmojiStatuses#18201aae = Bool; +account.reorderUsernames#ef500eab order:Vector = Bool; +account.toggleUsername#58d6b376 username:string active:Bool = Bool; users.getUsers#d91a548 id:Vector = Vector; users.getFullUser#b60f5918 id:InputUser = users.UserFull; @@ -1681,8 +1685,8 @@ messages.uploadMedia#519bc2b1 peer:InputPeer media:InputMedia = MessageMedia; messages.sendScreenshotNotification#c97df020 peer:InputPeer reply_to_msg_id:int random_id:long = Updates; messages.getFavedStickers#4f1aaa9 hash:long = messages.FavedStickers; 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.getUnreadMentions#f107e790 flags:# peer:InputPeer top_msg_id:flags.0?int offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages; +messages.readMentions#36e5bf4d flags:# peer:InputPeer top_msg_id:flags.0?int = messages.AffectedHistory; messages.getRecentLocations#702a40e0 peer:InputPeer limit:int hash:long = messages.Messages; messages.sendMultiMedia#f803138f flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true peer:InputPeer reply_to_msg_id:flags.0?int multi_media:Vector schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates; messages.uploadEncryptedFile#5057c497 peer:InputEncryptedChat file:InputEncryptedFile = EncryptedFile; @@ -1750,7 +1754,7 @@ messages.setChatAvailableReactions#feb16771 peer:InputPeer available_reactions:C messages.getAvailableReactions#18dea0ac hash:int = messages.AvailableReactions; messages.setDefaultReaction#4f47a016 reaction:Reaction = Bool; messages.translateText#24ce6dee flags:# peer:flags.0?InputPeer msg_id:flags.0?int text:flags.1?string from_lang:flags.2?string to_lang:string = messages.TranslatedText; -messages.getUnreadReactions#e85bae1a peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages; +messages.getUnreadReactions#3223495b flags:# peer:InputPeer top_msg_id:flags.0?int offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages; messages.readReactions#82e251d7 peer:InputPeer = messages.AffectedHistory; messages.searchSentMedia#107e31a0 q:string filter:MessagesFilter limit:int = messages.Messages; messages.getAttachMenuBots#16fcc2cb hash:long = AttachMenuBots; @@ -1855,6 +1859,8 @@ channels.getSendAs#dc770ee peer:InputPeer = channels.SendAsPeers; channels.deleteParticipantHistory#367544db channel:InputChannel participant:InputPeer = messages.AffectedHistory; channels.toggleJoinToSend#e4cb9580 channel:InputChannel enabled:Bool = Updates; channels.toggleJoinRequest#4c2985b6 channel:InputChannel enabled:Bool = Updates; +channels.reorderUsernames#b45ced1d channel:InputChannel order:Vector = Bool; +channels.toggleUsername#50f24105 channel:InputChannel username:string active:Bool = Bool; channels.toggleForum#a4298b29 channel:InputChannel enabled:Bool = Updates; channels.createForumTopic#60bf3bc9 flags:# channel:InputChannel title:string icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates; channels.getForumTopics#de560d1 flags:# channel:InputChannel q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics; diff --git a/Telegram/SourceFiles/api/api_unread_things.cpp b/Telegram/SourceFiles/api/api_unread_things.cpp index 344a5815d..ee85597a1 100644 --- a/Telegram/SourceFiles/api/api_unread_things.cpp +++ b/Telegram/SourceFiles/api/api_unread_things.cpp @@ -85,6 +85,7 @@ void UnreadThings::requestMentions(not_null history, int loaded) { if (_mentionsRequests.contains(history)) { return; } + const auto topMsgId = 0; const auto offsetId = std::max( history->unreadMentions().maxLoaded(), MsgId(1)); @@ -93,7 +94,9 @@ void UnreadThings::requestMentions(not_null history, int loaded) { const auto maxId = 0; const auto minId = 0; const auto requestId = _api->request(MTPmessages_GetUnreadMentions( + MTP_flags(0), history->peer->input, + MTP_int(topMsgId), MTP_int(offsetId), MTP_int(addOffset), MTP_int(limit), @@ -112,6 +115,7 @@ void UnreadThings::requestReactions(not_null history, int loaded) { if (_reactionsRequests.contains(history)) { return; } + const auto topMsgId = 0; const auto offsetId = loaded ? std::max(history->unreadReactions().maxLoaded(), MsgId(1)) : MsgId(1); @@ -120,7 +124,9 @@ void UnreadThings::requestReactions(not_null history, int loaded) { const auto maxId = 0; const auto minId = 0; const auto requestId = _api->request(MTPmessages_GetUnreadReactions( + MTP_flags(0), history->peer->input, + MTP_int(topMsgId), MTP_int(offsetId), MTP_int(addOffset), MTP_int(limit), diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 2367e6e20..c2bae883c 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -2428,8 +2428,7 @@ void ApiWrap::refreshFileReference( MTP_string(Data::CloudThemes::Format()), MTP_inputTheme( MTP_long(data.themeId), - MTP_long(data.accessHash)), - MTP_long(0))); + MTP_long(data.accessHash)))); }, [&](Data::FileOriginRingtones data) { request(MTPaccount_GetSavedRingtones(MTP_long(0))); }, [&](Data::FileOriginPremiumPreviews data) { diff --git a/Telegram/SourceFiles/boxes/reactions_settings_box.cpp b/Telegram/SourceFiles/boxes/reactions_settings_box.cpp index f13c27163..ce617370b 100644 --- a/Telegram/SourceFiles/boxes/reactions_settings_box.cpp +++ b/Telegram/SourceFiles/boxes/reactions_settings_box.cpp @@ -62,7 +62,8 @@ PeerId GenerateUser(not_null history, const QString &name) { MTPVector(), // restrictions MTPstring(), // bot placeholder MTPstring(), // lang code - MTPEmojiStatus())); + MTPEmojiStatus(), + MTPVector())); return peerId; } diff --git a/Telegram/SourceFiles/data/data_cloud_themes.cpp b/Telegram/SourceFiles/data/data_cloud_themes.cpp index 620939249..a215d36fb 100644 --- a/Telegram/SourceFiles/data/data_cloud_themes.cpp +++ b/Telegram/SourceFiles/data/data_cloud_themes.cpp @@ -188,8 +188,7 @@ void CloudThemes::reloadCurrent() { const auto &fields = Window::Theme::Background()->themeObject().cloud; _session->api().request(MTPaccount_GetTheme( MTP_string(Format()), - MTP_inputTheme(MTP_long(fields.id), MTP_long(fields.accessHash)), - MTP_long(fields.documentId) + MTP_inputTheme(MTP_long(fields.id), MTP_long(fields.accessHash)) )).done([=](const MTPTheme &result) { applyUpdate(result); }).fail([=] { @@ -218,8 +217,7 @@ void CloudThemes::resolve( _session->api().request(_resolveRequestId).cancel(); _resolveRequestId = _session->api().request(MTPaccount_GetTheme( MTP_string(Format()), - MTP_inputThemeSlug(MTP_string(slug)), - MTP_long(0) + MTP_inputThemeSlug(MTP_string(slug)) )).done([=](const MTPTheme &result) { showPreview(controller, result); }).fail([=](const MTP::Error &error) { diff --git a/Telegram/SourceFiles/data/data_session.cpp b/Telegram/SourceFiles/data/data_session.cpp index 345503f78..97913a364 100644 --- a/Telegram/SourceFiles/data/data_session.cpp +++ b/Telegram/SourceFiles/data/data_session.cpp @@ -3932,7 +3932,8 @@ void Session::serviceNotification( MTPVector(), MTPstring(), // bot_inline_placeholder MTPstring(), // lang_code - MTPEmojiStatus())); + MTPEmojiStatus(), + MTPVector())); } const auto history = this->history(PeerData::kServiceNotificationsId); if (!history->folderKnown()) { diff --git a/Telegram/SourceFiles/main/main_account.cpp b/Telegram/SourceFiles/main/main_account.cpp index 8416adfc5..6de1954c4 100644 --- a/Telegram/SourceFiles/main/main_account.cpp +++ b/Telegram/SourceFiles/main/main_account.cpp @@ -170,7 +170,8 @@ void Account::createSession( MTPVector(), MTPstring(), // bot_inline_placeholder MTPstring(), // lang_code - MTPEmojiStatus()), + MTPEmojiStatus(), + MTPVector()), serialized, streamVersion, std::move(settings)); diff --git a/Telegram/SourceFiles/menu/menu_send.cpp b/Telegram/SourceFiles/menu/menu_send.cpp index 8fbb95fd6..2fcd0c92d 100644 --- a/Telegram/SourceFiles/menu/menu_send.cpp +++ b/Telegram/SourceFiles/menu/menu_send.cpp @@ -187,10 +187,13 @@ void SetupReadAllMenu( void SetupUnreadMentionsMenu( not_null button, Fn currentPeer) { + const auto topMsgId = 0; const auto text = tr::lng_context_mark_read_mentions_all(tr::now); const auto sendRequest = [=](not_null peer, Fn done) { peer->session().api().request(MTPmessages_ReadMentions( - peer->input + MTP_flags(0), + peer->input, + MTP_int(topMsgId) )).done([=](const MTPmessages_AffectedHistory &result) { done(); peer->session().api().applyAffectedHistory(peer, result); diff --git a/Telegram/SourceFiles/window/themes/window_theme_editor_box.cpp b/Telegram/SourceFiles/window/themes/window_theme_editor_box.cpp index 1f00891cb..6e34990b7 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_editor_box.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_editor_box.cpp @@ -738,8 +738,7 @@ void SaveTheme( if (cloud.id) { window->account().session().api().request(MTPaccount_GetTheme( MTP_string(Data::CloudThemes::Format()), - MTP_inputTheme(MTP_long(cloud.id), MTP_long(cloud.accessHash)), - MTP_long(0) + MTP_inputTheme(MTP_long(cloud.id), MTP_long(cloud.accessHash)) )).done([=](const MTPTheme &result) { result.match([&](const MTPDtheme &data) { save(CloudTheme::Parse(&window->account().session(), data));