From a6c98f4bb44c8a5f55f86ea80f932a5d0a8be1e3 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 25 Aug 2021 11:15:05 +0300 Subject: [PATCH] Update API scheme to layer 133. --- Telegram/Resources/tl/api.tl | 337 +++++++++--------- Telegram/SourceFiles/api/api_hash.cpp | 38 +- Telegram/SourceFiles/api/api_hash.h | 41 ++- Telegram/SourceFiles/api/api_sending.cpp | 2 +- .../api/api_single_message_search.cpp | 2 +- .../SourceFiles/api/api_text_entities.cpp | 2 +- Telegram/SourceFiles/api/api_updates.cpp | 6 +- Telegram/SourceFiles/api/api_user_privacy.cpp | 6 +- Telegram/SourceFiles/apiwrap.cpp | 171 ++++----- Telegram/SourceFiles/apiwrap.h | 7 +- Telegram/SourceFiles/boxes/background_box.cpp | 2 +- .../boxes/peers/add_participants_box.cpp | 10 +- .../boxes/peers/edit_participants_box.cpp | 18 +- .../boxes/peers/edit_participants_box.h | 2 +- Telegram/SourceFiles/boxes/share_box.cpp | 2 +- .../SourceFiles/boxes/sticker_set_box.cpp | 18 +- Telegram/SourceFiles/boxes/stickers_box.cpp | 17 +- .../calls/calls_box_controller.cpp | 14 +- .../chat_helpers/stickers_list_widget.cpp | 12 +- Telegram/SourceFiles/core/update_checker.cpp | 2 +- Telegram/SourceFiles/data/data_channel.cpp | 23 +- Telegram/SourceFiles/data/data_channel.h | 14 - Telegram/SourceFiles/data/data_chat.cpp | 2 +- Telegram/SourceFiles/data/data_chat.h | 2 +- .../SourceFiles/data/data_cloud_themes.cpp | 13 +- Telegram/SourceFiles/data/data_cloud_themes.h | 3 +- Telegram/SourceFiles/data/data_group_call.cpp | 8 +- Telegram/SourceFiles/data/data_histories.cpp | 14 +- Telegram/SourceFiles/data/data_peer_id.cpp | 2 +- Telegram/SourceFiles/data/data_peer_id.h | 10 +- Telegram/SourceFiles/data/data_poll.cpp | 4 +- .../SourceFiles/data/data_replies_list.cpp | 6 +- .../data/data_scheduled_messages.cpp | 14 +- .../data/data_scheduled_messages.h | 2 +- .../data/data_search_controller.cpp | 8 +- Telegram/SourceFiles/data/data_session.cpp | 17 +- Telegram/SourceFiles/data/data_session.h | 6 +- .../data/stickers/data_stickers.cpp | 71 ++-- .../SourceFiles/data/stickers/data_stickers.h | 14 +- .../data/stickers/data_stickers_set.cpp | 16 +- .../data/stickers/data_stickers_set.h | 8 +- .../SourceFiles/dialogs/dialogs_widget.cpp | 38 +- .../export/data/export_data_types.cpp | 18 +- .../SourceFiles/export/export_api_wrap.cpp | 20 +- .../admin_log/history_admin_log_inner.cpp | 9 +- .../admin_log/history_admin_log_item.cpp | 10 +- .../SourceFiles/history/history_message.cpp | 2 +- .../SourceFiles/history/history_service.cpp | 2 +- .../SourceFiles/history/history_service.h | 2 +- .../SourceFiles/history/history_widget.cpp | 50 +-- .../info_common_groups_inner_widget.cpp | 4 +- .../inline_bots/inline_bot_send_data.cpp | 2 +- Telegram/SourceFiles/intro/intro_qr.cpp | 2 +- Telegram/SourceFiles/main/main_account.cpp | 2 +- .../passport/passport_form_controller.cpp | 4 +- .../settings/settings_privacy_controllers.cpp | 2 +- .../SourceFiles/storage/serialize_peer.cpp | 19 +- .../SourceFiles/storage/storage_account.cpp | 71 ++-- .../support/support_autocomplete.cpp | 2 +- .../SourceFiles/ui/image/image_location.cpp | 4 +- .../window/window_session_controller.cpp | 4 +- 61 files changed, 618 insertions(+), 615 deletions(-) diff --git a/Telegram/Resources/tl/api.tl b/Telegram/Resources/tl/api.tl index 82e59c8ba3..4e1cf48b4e 100644 --- a/Telegram/Resources/tl/api.tl +++ b/Telegram/Resources/tl/api.tl @@ -41,16 +41,16 @@ null#56730bcc = Null; inputPeerEmpty#7f3b18ea = InputPeer; inputPeerSelf#7da07ec9 = InputPeer; -inputPeerChat#179be863 chat_id:int = InputPeer; -inputPeerUser#7b8e7de6 user_id:int access_hash:long = InputPeer; -inputPeerChannel#20adaef8 channel_id:int access_hash:long = InputPeer; -inputPeerUserFromMessage#17bae2e6 peer:InputPeer msg_id:int user_id:int = InputPeer; -inputPeerChannelFromMessage#9c95f7bb peer:InputPeer msg_id:int channel_id:int = InputPeer; +inputPeerChat#35a95cb9 chat_id:long = InputPeer; +inputPeerUser#dde8a54c user_id:long access_hash:long = InputPeer; +inputPeerChannel#27bcbbfc channel_id:long access_hash:long = InputPeer; +inputPeerUserFromMessage#a87b0a1c peer:InputPeer msg_id:int user_id:long = InputPeer; +inputPeerChannelFromMessage#bd2a0840 peer:InputPeer msg_id:int channel_id:long = InputPeer; inputUserEmpty#b98886cf = InputUser; inputUserSelf#f7c1b13f = InputUser; -inputUser#d8292816 user_id:int access_hash:long = InputUser; -inputUserFromMessage#2d117597 peer:InputPeer msg_id:int user_id:int = InputUser; +inputUser#f21158c6 user_id:long access_hash:long = InputUser; +inputUserFromMessage#1da448e2 peer:InputPeer msg_id:int user_id:long = InputUser; inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact; @@ -94,9 +94,9 @@ inputPeerPhotoFileLocation#37257e99 flags:# big:flags.0?true peer:InputPeer phot inputStickerSetThumb#9d84f3db stickerset:InputStickerSet thumb_version:int = InputFileLocation; inputGroupCallStream#598a92a flags:# call:InputGroupCall time_ms:long scale:int video_channel:flags.0?int video_quality:flags.0?int = InputFileLocation; -peerUser#9db1bc6d user_id:int = Peer; -peerChat#bad0e5bb chat_id:int = Peer; -peerChannel#bddde532 channel_id:int = Peer; +peerUser#59511722 user_id:long = Peer; +peerChat#36c6019a chat_id:long = Peer; +peerChannel#a2a5371e channel_id:long = Peer; storage.fileUnknown#aa963b05 = storage.FileType; storage.filePartial#40bc6f52 = storage.FileType; @@ -109,8 +109,8 @@ storage.fileMov#4b09ebbc = storage.FileType; storage.fileMp4#b3cea0e4 = storage.FileType; storage.fileWebp#1081464c = storage.FileType; -userEmpty#200250ba id:int = User; -user#938458c1 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?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; +userEmpty#d3bc4b7a id:long = User; +user#3ff6ecb0 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 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 = User; userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto; userProfilePhoto#82d1f706 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto; @@ -122,33 +122,33 @@ userStatusRecently#e26f42f1 = UserStatus; userStatusLastWeek#7bf09fc = UserStatus; 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 call_active:flags.23?true call_not_empty:flags.24?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#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; +chatEmpty#29562865 id:long = Chat; +chat#41cbf256 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?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 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; +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#49a0a5d9 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 groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string = ChatFull; -channelFull#2f532f3c 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 groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string = ChatFull; +chatFull#4dbdc099 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 = ChatFull; +channelFull#e9b27a17 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:long 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?long 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?long 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 groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string = ChatFull; -chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant; -chatParticipantCreator#da13538a user_id:int = ChatParticipant; -chatParticipantAdmin#e2d6e436 user_id:int inviter_id:int date:int = ChatParticipant; +chatParticipant#c02d4007 user_id:long inviter_id:long date:int = ChatParticipant; +chatParticipantCreator#e46bcee4 user_id:long = ChatParticipant; +chatParticipantAdmin#a0933f5b user_id:long inviter_id:long date:int = ChatParticipant; -chatParticipantsForbidden#fc900c2b flags:# chat_id:int self_participant:flags.0?ChatParticipant = ChatParticipants; -chatParticipants#3f460fed chat_id:int participants:Vector version:int = ChatParticipants; +chatParticipantsForbidden#8763d3e1 flags:# chat_id:long self_participant:flags.0?ChatParticipant = ChatParticipants; +chatParticipants#3cbc93f8 chat_id:long participants:Vector version:int = ChatParticipants; chatPhotoEmpty#37c1011c = ChatPhoto; chatPhoto#1c6e1c11 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = ChatPhoto; messageEmpty#90a6ca84 flags:# id:int peer_id:flags.0?Peer = 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; +message#85d6cbe2 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?long 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; messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia; -messageMediaContact#cbf24940 phone_number:string first_name:string last_name:string vcard:string user_id:int = MessageMedia; +messageMediaContact#70322949 phone_number:string first_name:string last_name:string vcard:string user_id:long = MessageMedia; messageMediaUnsupported#9f84f49e = MessageMedia; messageMediaDocument#9cb070d7 flags:# document:flags.0?Document ttl_seconds:flags.2?int = MessageMedia; messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia; @@ -160,16 +160,16 @@ messageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia; messageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia; messageActionEmpty#b6aef7b0 = MessageAction; -messageActionChatCreate#a6638b9a title:string users:Vector = MessageAction; +messageActionChatCreate#bd47cbad title:string users:Vector = MessageAction; messageActionChatEditTitle#b5a1ce5a title:string = MessageAction; messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction; messageActionChatDeletePhoto#95e3fbef = MessageAction; -messageActionChatAddUser#488a7337 users:Vector = MessageAction; -messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction; -messageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction; +messageActionChatAddUser#15cefd00 users:Vector = MessageAction; +messageActionChatDeleteUser#a43f30cc user_id:long = MessageAction; +messageActionChatJoinedByLink#31224c3 inviter_id:long = MessageAction; messageActionChannelCreate#95d2ac92 title:string = MessageAction; -messageActionChatMigrateTo#51bdb021 channel_id:int = MessageAction; -messageActionChannelMigrateFrom#b055eaee title:string chat_id:int = MessageAction; +messageActionChatMigrateTo#e1037f92 channel_id:long = MessageAction; +messageActionChannelMigrateFrom#ea3948e9 title:string chat_id:long = MessageAction; messageActionPinMessage#94bd38ed = MessageAction; messageActionHistoryClear#9fbab604 = MessageAction; messageActionGameScore#92a72876 game_id:long score:int = MessageAction; @@ -184,7 +184,7 @@ messageActionSecureValuesSent#d95c6154 types:Vector = MessageAc 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; +messageActionInviteToGroupCall#502f92f7 call:InputGroupCall users:Vector = MessageAction; messageActionSetMessagesTTL#aa1afbfd period:int = MessageAction; messageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction; messageActionSetChatTheme#aa786345 emoticon:string = MessageAction; @@ -210,7 +210,7 @@ auth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string nex auth.authorization#cd050916 flags:# tmp_sessions:flags.0?int user:User = auth.Authorization; auth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization; -auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization; +auth.exportedAuthorization#b434e2b8 id:long bytes:bytes = auth.ExportedAuthorization; inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer; inputNotifyUsers#193b4417 = InputNotifyPeer; @@ -237,11 +237,11 @@ inputReportReasonFake#f5ddd6e7 = ReportReason; userFull#d697ff05 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 theme_emoticon:flags.15?string = UserFull; -contact#f911c994 user_id:int mutual:Bool = Contact; +contact#145ade0b user_id:long mutual:Bool = Contact; -importedContact#d0028438 user_id:int client_id:long = ImportedContact; +importedContact#c13e3c50 user_id:long client_id:long = ImportedContact; -contactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus; +contactStatus#16d9703b user_id:long status:UserStatus = ContactStatus; contacts.contactsNotModified#b74ba9d2 = contacts.Contacts; contacts.contacts#eae87e42 contacts:Vector saved_count:int users:Vector = contacts.Contacts; @@ -288,64 +288,64 @@ inputMessagesFilterPinned#1bb00451 = MessagesFilter; updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update; updateMessageID#4e90bfd6 id:int random_id:long = Update; updateDeleteMessages#a20db0e5 messages:Vector pts:int pts_count:int = Update; -updateUserTyping#5c486927 user_id:int action:SendMessageAction = Update; -updateChatUserTyping#86cadb6c chat_id:int from_id:Peer action:SendMessageAction = Update; +updateUserTyping#c01e857f user_id:long action:SendMessageAction = Update; +updateChatUserTyping#83487af0 chat_id:long from_id:Peer action:SendMessageAction = Update; updateChatParticipants#7761198 participants:ChatParticipants = Update; -updateUserStatus#1bfbd823 user_id:int status:UserStatus = Update; -updateUserName#a7332b73 user_id:int first_name:string last_name:string username:string = Update; -updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update; +updateUserStatus#e5bdf8de user_id:long status:UserStatus = Update; +updateUserName#c3f202e0 user_id:long first_name:string last_name:string username:string = Update; +updateUserPhoto#f227868c user_id:long date:int photo:UserProfilePhoto previous:Bool = Update; updateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update; updateEncryptedChatTyping#1710f156 chat_id:int = Update; updateEncryption#b4a2e88d chat:EncryptedChat date:int = Update; updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update; -updateChatParticipantAdd#ea4b0e5c chat_id:int user_id:int inviter_id:int date:int version:int = Update; -updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update; +updateChatParticipantAdd#3dda5451 chat_id:long user_id:long inviter_id:long date:int version:int = Update; +updateChatParticipantDelete#e32f3d77 chat_id:long user_id:long version:int = Update; updateDcOptions#8e5e9873 dc_options:Vector = Update; updateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update; updateServiceNotification#ebe46819 flags:# popup:flags.0?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector = Update; updatePrivacy#ee3b272a key:PrivacyKey rules:Vector = Update; -updateUserPhone#12b9417b user_id:int phone:string = Update; +updateUserPhone#5492a13 user_id:long phone:string = Update; updateReadHistoryInbox#9c974fdf flags:# folder_id:flags.0?int peer:Peer max_id:int still_unread_count:int pts:int pts_count:int = Update; updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update; updateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update; updateReadMessagesContents#68c13933 messages:Vector pts:int pts_count:int = Update; -updateChannelTooLong#eb0467fb flags:# channel_id:int pts:flags.0?int = Update; -updateChannel#b6d45656 channel_id:int = Update; +updateChannelTooLong#108d941f flags:# channel_id:long pts:flags.0?int = Update; +updateChannel#635b4c09 channel_id:long = Update; updateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update; -updateReadChannelInbox#330b5424 flags:# folder_id:flags.0?int channel_id:int max_id:int still_unread_count:int pts:int = Update; -updateDeleteChannelMessages#c37521c9 channel_id:int messages:Vector pts:int pts_count:int = Update; -updateChannelMessageViews#98a12b4b channel_id:int id:int views:int = Update; -updateChatParticipantAdmin#b6901959 chat_id:int user_id:int is_admin:Bool version:int = Update; +updateReadChannelInbox#922e6e10 flags:# folder_id:flags.0?int channel_id:long max_id:int still_unread_count:int pts:int = Update; +updateDeleteChannelMessages#c32d5b12 channel_id:long messages:Vector pts:int pts_count:int = Update; +updateChannelMessageViews#f226ac08 channel_id:long id:int views:int = Update; +updateChatParticipantAdmin#d7ca61a2 chat_id:long user_id:long is_admin:Bool version:int = Update; updateNewStickerSet#688a30aa stickerset:messages.StickerSet = Update; updateStickerSetsOrder#bb2d201 flags:# masks:flags.0?true order:Vector = Update; updateStickerSets#43ae3dec = Update; updateSavedGifs#9375341e = Update; -updateBotInlineQuery#3f2038db flags:# query_id:long user_id:int query:string geo:flags.0?GeoPoint peer_type:flags.1?InlineQueryPeerType offset:string = Update; -updateBotInlineSend#e48f964 flags:# user_id:int query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update; +updateBotInlineQuery#496f379c flags:# query_id:long user_id:long query:string geo:flags.0?GeoPoint peer_type:flags.1?InlineQueryPeerType offset:string = Update; +updateBotInlineSend#12f12a07 flags:# user_id:long query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update; updateEditChannelMessage#1b3f4df7 message:Message pts:int pts_count:int = Update; -updateBotCallbackQuery#e73547e1 flags:# query_id:long user_id:int peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update; +updateBotCallbackQuery#b9cfc48d flags:# query_id:long user_id:long peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update; updateEditMessage#e40370a3 message:Message pts:int pts_count:int = Update; -updateInlineBotCallbackQuery#f9d27a5a flags:# query_id:long user_id:int msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update; -updateReadChannelOutbox#25d6c9c7 channel_id:int max_id:int = Update; +updateInlineBotCallbackQuery#691e9052 flags:# query_id:long user_id:long msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update; +updateReadChannelOutbox#b75f99a9 channel_id:long max_id:int = Update; updateDraftMessage#ee2bb969 peer:Peer draft:DraftMessage = Update; updateReadFeaturedStickers#571d2742 = Update; updateRecentStickers#9a422c20 = Update; updateConfig#a229dd06 = Update; updatePtsChanged#3354678f = Update; -updateChannelWebPage#40771900 channel_id:int webpage:WebPage pts:int pts_count:int = Update; +updateChannelWebPage#2f2ba99f channel_id:long webpage:WebPage pts:int pts_count:int = Update; updateDialogPinned#6e6fe51c flags:# pinned:flags.0?true folder_id:flags.1?int peer:DialogPeer = Update; updatePinnedDialogs#fa0f3ca2 flags:# folder_id:flags.1?int order:flags.0?Vector = Update; updateBotWebhookJSON#8317c0c3 data:DataJSON = Update; updateBotWebhookJSONQuery#9b9240a6 query_id:long data:DataJSON timeout:int = Update; -updateBotShippingQuery#e0cdc940 query_id:long user_id:int payload:bytes shipping_address:PostAddress = Update; -updateBotPrecheckoutQuery#5d2f3aa9 flags:# query_id:long user_id:int payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update; +updateBotShippingQuery#b5aefd7d query_id:long user_id:long payload:bytes shipping_address:PostAddress = Update; +updateBotPrecheckoutQuery#8caa9a96 flags:# query_id:long user_id:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update; updatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update; updateLangPackTooLong#46560264 lang_code:string = Update; updateLangPack#56022f4d difference:LangPackDifference = Update; updateFavedStickers#e511996d = Update; -updateChannelReadMessagesContents#89893b45 channel_id:int messages:Vector = Update; +updateChannelReadMessagesContents#44bdd535 channel_id:long messages:Vector = Update; updateContactsReset#7084a7be = Update; -updateChannelAvailableMessages#70db6837 channel_id:int available_min_id:int = Update; +updateChannelAvailableMessages#b23fc698 channel_id:long available_min_id:int = Update; updateDialogUnreadMark#e16459c3 flags:# unread:flags.0?true peer:DialogPeer = Update; updateMessagePoll#aca1657b flags:# poll_id:long poll:flags.0?Poll results:PollResults = Update; updateChatDefaultBannedRights#54c01850 peer:Peer default_banned_rights:ChatBannedRights version:int = Update; @@ -357,27 +357,27 @@ updateDeleteScheduledMessages#90866cee peer:Peer messages:Vector = Update; updateTheme#8216fba3 theme:Theme = Update; updateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update; updateLoginToken#564fe691 = Update; -updateMessagePollVote#37f69f0b poll_id:long user_id:int options:Vector qts:int = Update; +updateMessagePollVote#106395c9 poll_id:long user_id:long options:Vector qts:int = Update; 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; -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; +updateChannelMessageForwards#d29a27f4 channel_id:long id:int forwards:int = Update; +updateReadChannelDiscussionInbox#d6b19546 flags:# channel_id:long top_msg_id:int read_max_id:int broadcast_id:flags.0?long broadcast_post:flags.0?int = Update; +updateReadChannelDiscussionOutbox#695c9e7c channel_id:long top_msg_id:int read_max_id:int = Update; updatePeerBlocked#246a4b22 peer_id:Peer blocked:Bool = Update; -updateChannelUserTyping#6b171718 flags:# channel_id:int top_msg_id:flags.0?int from_id:Peer action:SendMessageAction = Update; +updateChannelUserTyping#8c88c923 flags:# channel_id:long top_msg_id:flags.0?int from_id:Peer action:SendMessageAction = Update; updatePinnedMessages#ed85eab5 flags:# pinned:flags.0?true peer:Peer messages:Vector pts:int pts_count:int = Update; -updatePinnedChannelMessages#8588878b flags:# pinned:flags.0?true channel_id:int messages:Vector pts:int pts_count:int = Update; -updateChat#1330a196 chat_id:int = Update; +updatePinnedChannelMessages#5bb98608 flags:# pinned:flags.0?true channel_id:long messages:Vector pts:int pts_count:int = Update; +updateChat#f89a6a4e chat_id:long = Update; updateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector version:int = Update; -updateGroupCall#a45eb99b chat_id:int call:GroupCall = Update; +updateGroupCall#14b24500 chat_id:long call:GroupCall = Update; updatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update; -updateChatParticipant#f3b3781f flags:# chat_id:int date:int actor_id:int user_id:int prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update; -updateChannelParticipant#7fecb1ec flags:# channel_id:int date:int actor_id: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; +updateChatParticipant#d087663a flags:# chat_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update; +updateChannelParticipant#985d3abb flags:# channel_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update; +updateBotStopped#c4870a49 user_id:long date:int stopped:Bool qts:int = Update; updateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJSON = Update; -updateBotCommands#cf7e0873 peer:Peer bot_id:int commands:Vector = Update; +updateBotCommands#4d712f2e peer:Peer bot_id:long commands:Vector = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -387,8 +387,8 @@ updates.differenceSlice#a8fb1981 new_messages:Vector new_encrypted_mess updates.differenceTooLong#4afe8f6d pts:int = updates.Difference; updatesTooLong#e317af7e = 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; +updateShortMessage#313bc7f8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector ttl_period:flags.25?int = Updates; +updateShortChatMessage#4d6deea5 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:long chat_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long 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; @@ -414,9 +414,9 @@ help.noAppUpdate#c45a6536 = help.AppUpdate; help.inviteText#18cb9f78 message:string = help.InviteText; encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat; -encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat; -encryptedChatRequested#62718a82 flags:# folder_id:flags.0?int id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat; -encryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat; +encryptedChatWaiting#66b25953 id:int access_hash:long date:int admin_id:long participant_id:long = EncryptedChat; +encryptedChatRequested#48f1d94c flags:# folder_id:flags.0?int id:int access_hash:long date:int admin_id:long participant_id:long g_a:bytes = EncryptedChat; +encryptedChat#61f0d4c7 id:int access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long = EncryptedChat; encryptedChatDiscarded#1e1c7c45 flags:# history_deleted:flags.0?true id:int = EncryptedChat; inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat; @@ -494,17 +494,17 @@ inputPrivacyValueAllowUsers#131cc67f users:Vector = InputPrivacyRule; inputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule; inputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule; inputPrivacyValueDisallowUsers#90110467 users:Vector = InputPrivacyRule; -inputPrivacyValueAllowChatParticipants#4c81c1ba chats:Vector = InputPrivacyRule; -inputPrivacyValueDisallowChatParticipants#d82363af chats:Vector = InputPrivacyRule; +inputPrivacyValueAllowChatParticipants#840649cf chats:Vector = InputPrivacyRule; +inputPrivacyValueDisallowChatParticipants#e94f0f86 chats:Vector = InputPrivacyRule; privacyValueAllowContacts#fffe1bac = PrivacyRule; privacyValueAllowAll#65427b82 = PrivacyRule; -privacyValueAllowUsers#4d5bbe0c users:Vector = PrivacyRule; +privacyValueAllowUsers#b8905fb2 users:Vector = PrivacyRule; privacyValueDisallowContacts#f888fa1a = PrivacyRule; privacyValueDisallowAll#8b73e763 = PrivacyRule; -privacyValueDisallowUsers#c7f49b7 users:Vector = PrivacyRule; -privacyValueAllowChatParticipants#18be796b chats:Vector = PrivacyRule; -privacyValueDisallowChatParticipants#acae0690 chats:Vector = PrivacyRule; +privacyValueDisallowUsers#e4621141 users:Vector = PrivacyRule; +privacyValueAllowChatParticipants#6b134e8e chats:Vector = PrivacyRule; +privacyValueDisallowChatParticipants#41c87565 chats:Vector = PrivacyRule; account.privacyRules#50a04e45 rules:Vector chats:Vector users:Vector = account.PrivacyRules; @@ -519,12 +519,12 @@ documentAttributeFilename#15590068 file_name:string = DocumentAttribute; documentAttributeHasStickers#9801d2f7 = DocumentAttribute; messages.stickersNotModified#f1749a22 = messages.Stickers; -messages.stickers#e4599bbd hash:int stickers:Vector = messages.Stickers; +messages.stickers#30a6ec7e hash:long stickers:Vector = messages.Stickers; stickerPack#12b299d4 emoticon:string documents:Vector = StickerPack; messages.allStickersNotModified#e86602c3 = messages.AllStickers; -messages.allStickers#edfd405f hash:int sets:Vector = messages.AllStickers; +messages.allStickers#cdbbcebb hash:long sets:Vector = messages.AllStickers; messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages; @@ -547,7 +547,7 @@ auth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery; receivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage; -chatInviteExported#6e24fc9d flags:# revoked:flags.0?true permanent:flags.5?true link:string admin_id:int date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int = ExportedChatInvite; +chatInviteExported#b18105e8 flags:# revoked:flags.0?true permanent:flags.5?true link:string admin_id:long date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int = ExportedChatInvite; chatInviteAlready#5a686d7c chat:Chat = ChatInvite; chatInvite#dfc2f58e flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true title:string photo:Photo participants_count:int participants:flags.4?Vector = ChatInvite; @@ -565,7 +565,7 @@ messages.stickerSet#b60a24a6 set:StickerSet packs:Vector documents: botCommand#c27ac8c7 command:string description:string = BotCommand; -botInfo#98e81d3a user_id:int description:string commands:Vector = BotInfo; +botInfo#1b74b335 user_id:long description:string commands:Vector = BotInfo; keyboardButton#a2fa4880 text:string = KeyboardButton; keyboardButtonUrl#258aff05 text:string url:string = KeyboardButton; @@ -597,7 +597,7 @@ messageEntityItalic#826f8b60 offset:int length:int = MessageEntity; messageEntityCode#28a20571 offset:int length:int = MessageEntity; messageEntityPre#73924be0 offset:int length:int language:string = MessageEntity; messageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity; -messageEntityMentionName#352dca58 offset:int length:int user_id:int = MessageEntity; +messageEntityMentionName#dc7b1140 offset:int length:int user_id:long = MessageEntity; inputMessageEntityMentionName#208e68c9 offset:int length:int user_id:InputUser = MessageEntity; messageEntityPhone#9b69e34b offset:int length:int = MessageEntity; messageEntityCashtag#4c4e743f offset:int length:int = MessageEntity; @@ -607,8 +607,8 @@ messageEntityBlockquote#20df5d0 offset:int length:int = MessageEntity; messageEntityBankCard#761e6af4 offset:int length:int = MessageEntity; inputChannelEmpty#ee8c1e86 = InputChannel; -inputChannel#afeb712e channel_id:int access_hash:long = InputChannel; -inputChannelFromMessage#2a286531 peer:InputPeer msg_id:int channel_id:int = InputChannel; +inputChannel#f35aec28 channel_id:long access_hash:long = InputChannel; +inputChannelFromMessage#5b934f9d peer:InputPeer msg_id:int channel_id:long = InputChannel; contacts.resolvedPeer#7f077ad9 peer:Peer chats:Vector users:Vector = contacts.ResolvedPeer; @@ -621,11 +621,11 @@ updates.channelDifference#2064674e flags:# final:flags.0?true pts:int timeout:fl channelMessagesFilterEmpty#94d42ee7 = ChannelMessagesFilter; channelMessagesFilter#cd77d957 flags:# exclude_new_messages:flags.1?true ranges:Vector = ChannelMessagesFilter; -channelParticipant#15ebac1d user_id:int date:int = ChannelParticipant; -channelParticipantSelf#a3289a6d user_id:int inviter_id:int date:int = ChannelParticipant; -channelParticipantCreator#447dca4b flags:# user_id:int admin_rights:ChatAdminRights rank:flags.0?string = ChannelParticipant; -channelParticipantAdmin#ccbebbaf flags:# can_edit:flags.0?true self:flags.1?true user_id:int inviter_id:flags.1?int promoted_by:int date:int admin_rights:ChatAdminRights rank:flags.2?string = ChannelParticipant; -channelParticipantBanned#50a1dfd6 flags:# left:flags.0?true peer:Peer kicked_by:int date:int banned_rights:ChatBannedRights = ChannelParticipant; +channelParticipant#c00c07c0 user_id:long date:int = ChannelParticipant; +channelParticipantSelf#28a8bc67 user_id:long inviter_id:long date:int = ChannelParticipant; +channelParticipantCreator#2fe601d3 flags:# user_id:long admin_rights:ChatAdminRights rank:flags.0?string = ChannelParticipant; +channelParticipantAdmin#34c3bb53 flags:# can_edit:flags.0?true self:flags.1?true user_id:long inviter_id:flags.1?long promoted_by:long date:int admin_rights:ChatAdminRights rank:flags.2?string = ChannelParticipant; +channelParticipantBanned#6df8014e flags:# left:flags.0?true peer:Peer kicked_by:long date:int banned_rights:ChatBannedRights = ChannelParticipant; channelParticipantLeft#1b03f006 peer:Peer = ChannelParticipant; channelParticipantsRecent#de3f3c79 = ChannelParticipantsFilter; @@ -645,7 +645,7 @@ channels.channelParticipant#dfb80317 participant:ChannelParticipant chats:Vector help.termsOfService#780a0310 flags:# popup:flags.0?true id:DataJSON text:string entities:Vector min_age_confirm:flags.1?int = help.TermsOfService; messages.savedGifsNotModified#e8025ca2 = messages.SavedGifs; -messages.savedGifs#2e0709a5 hash:int gifs:Vector = messages.SavedGifs; +messages.savedGifs#84a02a0d hash:long gifs:Vector = messages.SavedGifs; inputBotInlineMessageMediaAuto#3380c786 flags:# message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; inputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; @@ -690,6 +690,7 @@ messages.botCallbackAnswer#36585ea4 flags:# alert:flags.1?true has_url:flags.3?t messages.messageEditData#26b5dde6 flags:# caption:flags.0?true = messages.MessageEditData; inputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID; +inputBotInlineMessageID64#b6d915d7 dc_id:int owner_id:long id:int access_hash:long = InputBotInlineMessageID; inlineBotSwitchPM#3c20629f text:string start_param:string = InlineBotSwitchPM; @@ -716,10 +717,10 @@ draftMessageEmpty#1b0c841a flags:# date:flags.0?int = DraftMessage; draftMessage#fd8e711f flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int message:string entities:flags.3?Vector date:int = DraftMessage; messages.featuredStickersNotModified#c6dc0c66 count:int = messages.FeaturedStickers; -messages.featuredStickers#b6abc341 hash:int count:int sets:Vector unread:Vector = messages.FeaturedStickers; +messages.featuredStickers#84c02310 hash:long count:int sets:Vector unread:Vector = messages.FeaturedStickers; messages.recentStickersNotModified#b17f890 = messages.RecentStickers; -messages.recentStickers#22f3afb3 hash:int packs:Vector stickers:Vector dates:Vector = messages.RecentStickers; +messages.recentStickers#88d37c56 hash:long packs:Vector stickers:Vector dates:Vector = messages.RecentStickers; messages.archivedStickers#4fcba9c8 count:int sets:Vector = messages.ArchivedStickers; @@ -739,7 +740,7 @@ game#bdf9653b flags:# id:long access_hash:long short_name:string title:string de inputGameID#32c3e77 id:long access_hash:long = InputGame; inputGameShortName#c331e80a bot_id:InputUser short_name:string = InputGame; -highScore#58fffcd0 pos:int user_id:int score:int = HighScore; +highScore#73a379eb pos:int user_id:long score:int = HighScore; messages.highScores#9a3bfd99 scores:Vector users:Vector = messages.HighScores; @@ -819,14 +820,14 @@ inputWebFileGeoPointLocation#9f2221c9 geo_point:InputGeoPoint access_hash:long w upload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile; -payments.paymentForm#8d0b2415 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:int invoice:Invoice provider_id:int url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector = payments.PaymentForm; +payments.paymentForm#1694761b flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:long invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector = payments.PaymentForm; payments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector = payments.ValidatedRequestedInfo; payments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult; payments.paymentVerificationNeeded#d8411139 url:string = payments.PaymentResult; -payments.paymentReceipt#10b555d0 flags:# date:int bot_id:int provider_id:int title:string description:string photo:flags.2?WebDocument invoice:Invoice info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption tip_amount:flags.3?long currency:string total_amount:long credentials_title:string users:Vector = payments.PaymentReceipt; +payments.paymentReceipt#70c4fe03 flags:# date:int bot_id:long provider_id:long title:string description:string photo:flags.2?WebDocument invoice:Invoice info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption tip_amount:flags.3?long currency:string total_amount:long credentials_title:string users:Vector = payments.PaymentReceipt; payments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo; @@ -844,10 +845,10 @@ inputStickerSetItem#ffa0a496 flags:# document:InputDocument emoji:string mask_co inputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall; phoneCallEmpty#5366c915 id:long = PhoneCall; -phoneCallWaiting#1b8f4ad1 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall; -phoneCallRequested#87eabb53 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall; -phoneCallAccepted#997c454a flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_b:bytes protocol:PhoneCallProtocol = PhoneCall; -phoneCall#8742ae7f flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector start_date:int = PhoneCall; +phoneCallWaiting#c5226f17 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall; +phoneCallRequested#14b0ed0c flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall; +phoneCallAccepted#3660c311 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_b:bytes protocol:PhoneCallProtocol = PhoneCall; +phoneCall#967f7c67 flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector start_date:int = PhoneCall; phoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall; phoneConnection#9d4c17c0 id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection; @@ -890,7 +891,7 @@ channelAdminLogEventActionChangeStickerSet#b1c3caa7 prev_stickerset:InputSticker channelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 new_value:Bool = ChannelAdminLogEventAction; channelAdminLogEventActionDefaultBannedRights#2df5fc0a prev_banned_rights:ChatBannedRights new_banned_rights:ChatBannedRights = ChannelAdminLogEventAction; channelAdminLogEventActionStopPoll#8f079643 message:Message = ChannelAdminLogEventAction; -channelAdminLogEventActionChangeLinkedChat#a26f881b prev_value:int new_value:int = ChannelAdminLogEventAction; +channelAdminLogEventActionChangeLinkedChat#50c7ac8 prev_value:long new_value:long = ChannelAdminLogEventAction; channelAdminLogEventActionChangeLocation#e6b76ae prev_value:ChannelLocation new_value:ChannelLocation = ChannelAdminLogEventAction; channelAdminLogEventActionToggleSlowMode#53909779 prev_value:int new_value:int = ChannelAdminLogEventAction; channelAdminLogEventActionStartGroupCall#23209745 call:InputGroupCall = ChannelAdminLogEventAction; @@ -904,8 +905,9 @@ channelAdminLogEventActionExportedInviteRevoke#410a134e invite:ExportedChatInvit channelAdminLogEventActionExportedInviteEdit#e90ebb59 prev_invite:ExportedChatInvite new_invite:ExportedChatInvite = ChannelAdminLogEventAction; channelAdminLogEventActionParticipantVolume#3e7f6847 participant:GroupCallParticipant = ChannelAdminLogEventAction; channelAdminLogEventActionChangeHistoryTTL#6e941a38 prev_value:int new_value:int = ChannelAdminLogEventAction; +channelAdminLogEventActionChangeTheme#fe69018d prev_value:string new_value:string = ChannelAdminLogEventAction; -channelAdminLogEvent#3b5a3e40 id:long date:int user_id:int action:ChannelAdminLogEventAction = ChannelAdminLogEvent; +channelAdminLogEvent#1fad68cd id:long date:int user_id:long action:ChannelAdminLogEventAction = ChannelAdminLogEvent; channels.adminLogResults#ed8af74d events:Vector chats:Vector users:Vector = channels.AdminLogResults; @@ -914,11 +916,11 @@ channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?tru popularContact#5ce14175 client_id:long importers:int = PopularContact; messages.favedStickersNotModified#9e8fa6d3 = messages.FavedStickers; -messages.favedStickers#f37f2f16 hash:int packs:Vector stickers:Vector = messages.FavedStickers; +messages.favedStickers#2cb51097 hash:long packs:Vector stickers:Vector = messages.FavedStickers; recentMeUrlUnknown#46e1d13d url:string = RecentMeUrl; -recentMeUrlUser#8dbc3336 url:string user_id:int = RecentMeUrl; -recentMeUrlChat#a01b22f9 url:string chat_id:int = RecentMeUrl; +recentMeUrlUser#b92c09e2 url:string user_id:long = RecentMeUrl; +recentMeUrlChat#b2da71d2 url:string chat_id:long = RecentMeUrl; recentMeUrlChatInvite#eb49081d url:string chat_invite:ChatInvite = RecentMeUrl; recentMeUrlStickerSet#bc0a57dc url:string set:StickerSetCovered = RecentMeUrl; @@ -926,7 +928,7 @@ help.recentMeUrls#e0310d7 urls:Vector chats:Vector users:Vect inputSingleMedia#1cc6e91f flags:# media:InputMedia random_id:long message:string entities:flags.0?Vector = InputSingleMedia; -webAuthorization#cac943f2 hash:long bot_id:int domain:string browser:string platform:string date_created:int date_active:int ip:string region:string = WebAuthorization; +webAuthorization#a6f8f452 hash:long bot_id:long domain:string browser:string platform:string date_created:int date_active:int ip:string region:string = WebAuthorization; account.webAuthorizations#ed56c9fc authorizations:Vector users:Vector = account.WebAuthorizations; @@ -942,7 +944,7 @@ dialogPeer#e56dbf05 peer:Peer = DialogPeer; dialogPeerFolder#514519e2 folder_id:int = DialogPeer; messages.foundStickerSetsNotModified#d54b65d = messages.FoundStickerSets; -messages.foundStickerSets#5108d648 hash:int sets:Vector = messages.FoundStickerSets; +messages.foundStickerSets#8af09dd2 hash:long sets:Vector = messages.FoundStickerSets; fileHash#6242c773 offset:int limit:int hash:bytes = FileHash; @@ -1061,7 +1063,7 @@ poll#86e18161 id:long flags:# closed:flags.0?true public_voters:flags.1?true mul pollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters; -pollResults#badcc1a3 flags:# min:flags.0?true results:flags.1?Vector total_voters:flags.2?int recent_voters:flags.3?Vector solution:flags.4?string solution_entities:flags.4?Vector = PollResults; +pollResults#dcb82ea3 flags:# min:flags.0?true results:flags.1?Vector total_voters:flags.2?int recent_voters:flags.3?Vector solution:flags.4?string solution_entities:flags.4?Vector = PollResults; chatOnlines#f041e250 onlines:int = ChatOnlines; @@ -1076,7 +1078,7 @@ inputWallPaperSlug#72091c80 slug:string = InputWallPaper; inputWallPaperNoFile#967a462e id:long = InputWallPaper; account.wallPapersNotModified#1c199183 = account.WallPapers; -account.wallPapers#702b65a9 hash:int wallpapers:Vector = account.WallPapers; +account.wallPapers#cdc3858c hash:long wallpapers:Vector = account.WallPapers; codeSettings#debebe83 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true = CodeSettings; @@ -1121,7 +1123,7 @@ inputThemeSlug#f5890df1 slug:string = InputTheme; theme#e802b8dc flags:# creator:flags.0?true default:flags.1?true for_chat:flags.5?true id:long access_hash:long slug:string title:string document:flags.2?Document settings:flags.3?ThemeSettings installs_count:flags.4?int = Theme; account.themesNotModified#f41eb622 = account.Themes; -account.themes#7f676421 hash:int themes:Vector = account.Themes; +account.themes#9a3d8c6d hash:long themes:Vector = account.Themes; auth.loginToken#629f1980 expires:int token:bytes = auth.LoginToken; auth.loginTokenMigrateTo#68e9916 dc_id:int token:bytes = auth.LoginToken; @@ -1137,15 +1139,15 @@ baseThemeNight#b7b31ea8 = BaseTheme; baseThemeTinted#6d5f77ee = BaseTheme; baseThemeArctic#5b11125a = BaseTheme; -inputThemeSettings#ff38f912 flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int message_colors:flags.0?Vector wallpaper:flags.1?InputWallPaper wallpaper_settings:flags.1?WallPaperSettings = InputThemeSettings; +inputThemeSettings#8fde504f flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int outbox_accent_color:flags.3?int message_colors:flags.0?Vector wallpaper:flags.1?InputWallPaper wallpaper_settings:flags.1?WallPaperSettings = InputThemeSettings; -themeSettings#8db4e76c flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int message_colors:flags.0?Vector wallpaper:flags.1?WallPaper = ThemeSettings; +themeSettings#fa58b6d4 flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int outbox_accent_color:flags.3?int message_colors:flags.0?Vector wallpaper:flags.1?WallPaper = ThemeSettings; webPageAttributeTheme#54b56617 flags:# documents:flags.0?Vector settings:flags.1?ThemeSettings = WebPageAttribute; -messageUserVote#a28e5559 user_id:int option:bytes date:int = MessageUserVote; -messageUserVoteInputOption#36377430 user_id:int date:int = MessageUserVote; -messageUserVoteMultiple#e8fe0de user_id:int options:Vector date:int = MessageUserVote; +messageUserVote#34d247b4 user_id:long option:bytes date:int = MessageUserVote; +messageUserVoteInputOption#3ca5b0ec user_id:long date:int = MessageUserVote; +messageUserVoteMultiple#8a65e557 user_id:long options:Vector date:int = MessageUserVote; messages.votesList#823f649 flags:# count:int votes:Vector users:Vector next_offset:flags.0?string = messages.VotesList; @@ -1176,11 +1178,11 @@ help.promoData#8c39793f flags:# proxy:flags.0?true expires:int peer:Peer chats:V videoSize#de33b094 flags:# type:string w:int h:int size:int video_start_ts:flags.0?double = VideoSize; -statsGroupTopPoster#18f3d0f7 user_id:int messages:int avg_chars:int = StatsGroupTopPoster; +statsGroupTopPoster#9d04af9b user_id:long messages:int avg_chars:int = StatsGroupTopPoster; -statsGroupTopAdmin#6014f412 user_id:int deleted:int kicked:int banned:int = StatsGroupTopAdmin; +statsGroupTopAdmin#d7584c87 user_id:long deleted:int kicked:int banned:int = StatsGroupTopAdmin; -statsGroupTopInviter#31962a4c user_id:int invitations:int = StatsGroupTopInviter; +statsGroupTopInviter#535f779d user_id:long invitations:int = StatsGroupTopInviter; stats.megagroupStats#ef7ff916 period:StatsDateRangeDays members:StatsAbsValueAndPrev messages:StatsAbsValueAndPrev viewers:StatsAbsValueAndPrev posters:StatsAbsValueAndPrev growth_graph:StatsGraph members_graph:StatsGraph new_members_by_source_graph:StatsGraph languages_graph:StatsGraph messages_graph:StatsGraph actions_graph:StatsGraph top_hours_graph:StatsGraph weekdays_graph:StatsGraph top_posters:Vector top_admins:Vector top_inviters:Vector users:Vector = stats.MegagroupStats; @@ -1201,7 +1203,7 @@ messages.discussionMessage#a6341782 flags:# messages:Vector max_id:flag messageReplyHeader#a6d57763 flags:# reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader; -messageReplies#4128faac flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector channel_id:flags.0?int max_id:flags.2?int read_max_id:flags.3?int = MessageReplies; +messageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector channel_id:flags.0?long max_id:flags.2?int read_max_id:flags.3?int = MessageReplies; peerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked; @@ -1230,7 +1232,7 @@ 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; +chatInviteImporter#b5cd5f4 user_id:long date:int = ChatInviteImporter; messages.exportedChatInvites#bdc62dcc count:int invites:Vector users:Vector = messages.ExportedChatInvites; @@ -1239,7 +1241,7 @@ messages.exportedChatInviteReplaced#222600ef invite:ExportedChatInvite new_invit messages.chatInviteImporters#81b6b00a count:int importers:Vector users:Vector = messages.ChatInviteImporters; -chatAdminWithInvites#dfd2330f admin_id:int invites_count:int revoked_invites_count:int = ChatAdminWithInvites; +chatAdminWithInvites#f2ecef23 admin_id:long invites_count:int revoked_invites_count:int = ChatAdminWithInvites; messages.chatAdminsWithInvites#b69b72d7 admins:Vector users:Vector = messages.ChatAdminsWithInvites; @@ -1272,7 +1274,7 @@ chatTheme#ed0b5c33 emoticon:string theme:Theme dark_theme:Theme = ChatTheme; account.chatThemesNotModified#e011e1c4 = account.ChatThemes; account.chatThemes#fe4cbebd hash:int themes:Vector = account.ChatThemes; -sponsoredMessage#f671f0d1 flags:# random_id:bytes peer_id:Peer from_id:Peer message:string media:flags.0?MessageMedia entities:flags.1?Vector = SponsoredMessage; +sponsoredMessage#2a3c381f flags:# random_id:bytes from_id:Peer start_param:flags.0?string message:string entities:flags.1?Vector = SponsoredMessage; messages.sponsoredMessages#65a4c7d5 messages:Vector chats:Vector users:Vector = messages.SponsoredMessages; @@ -1292,7 +1294,7 @@ auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:strin auth.logOut#5717da40 = Bool; auth.resetAuthorizations#9fab0d1a = Bool; auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization; -auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization; +auth.importAuthorization#a57a7dad id:long bytes:bytes = auth.Authorization; auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool; auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization; auth.checkPassword#d18b4d16 password:InputCheckPasswordSRP = auth.Authorization; @@ -1301,19 +1303,19 @@ auth.recoverPassword#37096c70 flags:# code:string new_settings:flags.0?account.P auth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode; auth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool; auth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector = Bool; -auth.exportLoginToken#b1b41517 api_id:int api_hash:string except_ids:Vector = auth.LoginToken; +auth.exportLoginToken#b7e085fe api_id:int api_hash:string except_ids:Vector = auth.LoginToken; auth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken; auth.acceptLoginToken#e894ad4d token:bytes = Authorization; auth.checkRecoveryPassword#d36bf79 code:string = Bool; -account.registerDevice#68976c6f flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector = Bool; -account.unregisterDevice#3076c4bf token_type:int token:string other_uids:Vector = Bool; +account.registerDevice#ec86017a flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector = Bool; +account.unregisterDevice#6a0d3206 token_type:int token:string other_uids:Vector = Bool; account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool; account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings; 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.getWallPapers#7967d36 hash:long = account.WallPapers; account.reportPeer#c5ba3d86 peer:InputPeer reason:ReportReason message:string = Bool; account.checkUsername#2714d86c username:string = Bool; account.updateUsername#3e0bdd7c username:string = User; @@ -1340,8 +1342,8 @@ account.getAllSecureValues#b288bc7d = Vector; account.getSecureValue#73665bc2 types:Vector = Vector; account.saveSecureValue#899fe31d value:InputSecureValue secure_secret_id:long = SecureValue; account.deleteSecureValue#b880bc4b types:Vector = Bool; -account.getAuthorizationForm#b86ba8e1 bot_id:int scope:string public_key:string = account.AuthorizationForm; -account.acceptAuthorization#e7027c94 bot_id:int scope:string public_key:string value_hashes:Vector credentials:SecureCredentialsEncrypted = Bool; +account.getAuthorizationForm#a929597a bot_id:long scope:string public_key:string = account.AuthorizationForm; +account.acceptAuthorization#f3ed4c73 bot_id:long scope:string public_key:string value_hashes:Vector credentials:SecureCredentialsEncrypted = Bool; account.sendVerifyPhoneCode#a5a356f9 phone_number:string settings:CodeSettings = auth.SentCode; account.verifyPhone#4dd3a7f6 phone_number:string phone_code_hash:string phone_code:string = Bool; account.sendVerifyEmailCode#7011509f email:string = account.SentEmailCode; @@ -1367,7 +1369,7 @@ account.updateTheme#5cb367d5 flags:# format:string theme:InputTheme slug:flags.0 account.saveTheme#f257106c theme:InputTheme unsave:Bool = Bool; account.installTheme#7ae43737 flags:# dark:flags.0?true format:flags.1?string theme:flags.1?InputTheme = Bool; account.getTheme#8d9d742b format:string theme:InputTheme document_id:long = Theme; -account.getThemes#285946f8 format:string hash:int = account.Themes; +account.getThemes#7206e458 format:string hash:long = account.Themes; account.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool; account.getContentSettings#8b9b4dae = account.ContentSettings; account.getMultiWallPapers#65ad71dc wallpapers:Vector = Vector; @@ -1382,9 +1384,9 @@ users.getUsers#d91a548 id:Vector = Vector; users.getFullUser#ca30a5b1 id:InputUser = UserFull; users.setSecureValueErrors#90c894b5 id:InputUser errors:Vector = Bool; -contacts.getContactIDs#2caa4a42 hash:int = Vector; +contacts.getContactIDs#7adc669d hash:long = Vector; contacts.getStatuses#c4a353ee = Vector; -contacts.getContacts#c023849f hash:int = contacts.Contacts; +contacts.getContacts#5dd69e12 hash:long = contacts.Contacts; contacts.importContacts#2c800be5 contacts:Vector = contacts.ImportedContacts; contacts.deleteContacts#96a0e00 id:Vector = Updates; contacts.deleteByPhones#1013fd9e phones:Vector = Bool; @@ -1393,7 +1395,7 @@ contacts.unblock#bea65d50 id:InputPeer = Bool; contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked; contacts.search#11f812d8 q:string limit:int = contacts.Found; contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer; -contacts.getTopPeers#d4982db5 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:int = contacts.TopPeers; +contacts.getTopPeers#973478b6 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:long = contacts.TopPeers; contacts.resetTopPeerRating#1ae373ac category:TopPeerCategory peer:InputPeer = Bool; contacts.resetSaved#879537f1 = Bool; contacts.getSaved#82f1e39f = Vector; @@ -1404,9 +1406,9 @@ contacts.getLocated#d348bc44 flags:# background:flags.1?true geo_point:InputGeoP contacts.blockFromReplies#29a8962c flags:# delete_message:flags.0?true delete_history:flags.1?true report_spam:flags.2?true msg_id:int = Updates; messages.getMessages#63c66506 id:Vector = messages.Messages; -messages.getDialogs#a0ee3b73 flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:int = messages.Dialogs; -messages.getHistory#dcbb8260 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages; -messages.search#c352eec flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages; +messages.getDialogs#a0f4cb4f flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.Dialogs; +messages.getHistory#4423e6c5 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages; +messages.search#a0fda762 flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages; messages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages; messages.deleteHistory#1c015b09 flags:# just_clear:flags.0?true revoke:flags.1?true peer:InputPeer max_id:int = messages.AffectedHistory; messages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector = messages.AffectedMessages; @@ -1418,12 +1420,12 @@ messages.forwardMessages#d9fee60e flags:# silent:flags.5?true background:flags.6 messages.reportSpam#cf1592db peer:InputPeer = Bool; messages.getPeerSettings#3672e09c peer:InputPeer = PeerSettings; 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; -messages.editChatPhoto#ca4c79d8 chat_id:int photo:InputChatPhoto = Updates; -messages.addChatUser#f9a0aa09 chat_id:int user_id:InputUser fwd_limit:int = Updates; -messages.deleteChatUser#c534459a flags:# revoke_history:flags.0?true chat_id:int user_id:InputUser = Updates; +messages.getChats#49e9528f id:Vector = messages.Chats; +messages.getFullChat#aeb00b34 chat_id:long = messages.ChatFull; +messages.editChatTitle#73783ffd chat_id:long title:string = Updates; +messages.editChatPhoto#35ddd674 chat_id:long photo:InputChatPhoto = Updates; +messages.addChatUser#f24753e3 chat_id:long user_id:InputUser fwd_limit:int = Updates; +messages.deleteChatUser#a2185cab flags:# revoke_history:flags.0?true chat_id:long user_id:InputUser = Updates; messages.createChat#9cb126e users:Vector title:string = Updates; messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig; messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat; @@ -1437,8 +1439,8 @@ messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long da messages.receivedQueue#55a5bb66 max_qts:int = Vector; messages.reportEncryptedSpam#4b0c8c0f peer:InputEncryptedChat = Bool; messages.readMessageContents#36a73f77 id:Vector = messages.AffectedMessages; -messages.getStickers#43d4f2c emoticon:string hash:int = messages.Stickers; -messages.getAllStickers#1c9618b1 hash:int = messages.AllStickers; +messages.getStickers#d5a5d3a1 emoticon:string hash:long = messages.Stickers; +messages.getAllStickers#b8a0a1a8 hash:long = messages.AllStickers; messages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector = MessageMedia; 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; @@ -1448,12 +1450,12 @@ messages.installStickerSet#c78fe460 stickerset:InputStickerSet archived:Bool = m messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool; messages.startBot#e6df7378 bot:InputUser peer:InputPeer random_id:long start_param:string = Updates; messages.getMessagesViews#5784d3e1 peer:InputPeer id:Vector increment:Bool = messages.MessageViews; -messages.editChatAdmin#a9e69f2e chat_id:int user_id:InputUser is_admin:Bool = Bool; -messages.migrateChat#15a3b8e3 chat_id:int = Updates; +messages.editChatAdmin#a85bd1c2 chat_id:long user_id:InputUser is_admin:Bool = Bool; +messages.migrateChat#a2875319 chat_id:long = Updates; messages.searchGlobal#4bc6589a flags:# folder_id:flags.0?int q:string filter:MessagesFilter min_date:int max_date:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages; messages.reorderStickerSets#78337739 flags:# masks:flags.0?true order:Vector = Bool; messages.getDocumentByHash#338e2464 sha256:bytes size:int mime_type:string = Document; -messages.getSavedGifs#83bf3d52 hash:int = messages.SavedGifs; +messages.getSavedGifs#5cf09635 hash:long = 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; @@ -1466,20 +1468,20 @@ messages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long messages.getPeerDialogs#e470bcfd peers:Vector = messages.PeerDialogs; messages.saveDraft#bc39e14b flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int peer:InputPeer message:string entities:flags.3?Vector = Bool; messages.getAllDrafts#6a3f8d65 = Updates; -messages.getFeaturedStickers#2dacca4f hash:int = messages.FeaturedStickers; +messages.getFeaturedStickers#64780b14 hash:long = messages.FeaturedStickers; messages.readFeaturedStickers#5b118126 id:Vector = Bool; -messages.getRecentStickers#5ea192c9 flags:# attached:flags.0?true hash:int = messages.RecentStickers; +messages.getRecentStickers#9da9403b flags:# attached:flags.0?true hash:long = messages.RecentStickers; messages.saveRecentSticker#392718f8 flags:# attached:flags.0?true id:InputDocument unsave:Bool = Bool; messages.clearRecentStickers#8999602d flags:# attached:flags.0?true = Bool; messages.getArchivedStickers#57f17692 flags:# masks:flags.0?true offset_id:long limit:int = messages.ArchivedStickers; -messages.getMaskStickers#65b8c79f hash:int = messages.AllStickers; +messages.getMaskStickers#640f82b8 hash:long = messages.AllStickers; messages.getAttachedStickers#cc5b67cc media:InputStickeredMedia = Vector; messages.setGameScore#8ef8ecc0 flags:# edit_message:flags.0?true force:flags.1?true peer:InputPeer id:int user_id:InputUser score:int = Updates; messages.setInlineGameScore#15ad9f64 flags:# edit_message:flags.0?true force:flags.1?true id:InputBotInlineMessageID user_id:InputUser score:int = Bool; messages.getGameHighScores#e822649d peer:InputPeer id:int user_id:InputUser = messages.HighScores; messages.getInlineGameHighScores#f635e1b id:InputBotInlineMessageID user_id:InputUser = messages.HighScores; -messages.getCommonChats#d0a48c4 user_id:InputUser max_id:int limit:int = messages.Chats; -messages.getAllChats#eba80ff0 except_ids:Vector = messages.Chats; +messages.getCommonChats#e40ca104 user_id:InputUser max_id:long limit:int = messages.Chats; +messages.getAllChats#875f74be except_ids:Vector = messages.Chats; messages.getWebPage#32ca8f91 url:string hash:int = WebPage; messages.toggleDialogPin#a731e257 flags:# pinned:flags.0?true peer:InputDialogPeer = Bool; messages.reorderPinnedDialogs#3b1adf37 flags:# force:flags.0?true folder_id:int order:Vector = Bool; @@ -1488,14 +1490,14 @@ messages.setBotShippingResults#e5f672fa flags:# query_id:long error:flags.0?stri messages.setBotPrecheckoutResults#9c2dd95 flags:# success:flags.1?true query_id:long error:flags.0?string = Bool; messages.uploadMedia#519bc2b1 peer:InputPeer media:InputMedia = MessageMedia; messages.sendScreenshotNotification#c97df020 peer:InputPeer reply_to_msg_id:int random_id:long = Updates; -messages.getFavedStickers#21ce0b0e hash:int = messages.FavedStickers; +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.getRecentLocations#bbc45b09 peer:InputPeer limit:int hash:int = messages.Messages; +messages.getRecentLocations#702a40e0 peer:InputPeer limit:int hash:long = messages.Messages; 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.searchStickerSets#35705b8a flags:# exclude_featured:flags.0?true q:string hash:long = messages.FoundStickerSets; messages.getSplitRanges#1cff7e08 = Vector; messages.markDialogUnread#c286d98f flags:# unread:flags.0?true peer:InputDialogPeer = Bool; messages.getDialogUnreadMarks#22e24e22 = Vector; @@ -1515,7 +1517,7 @@ 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; @@ -1525,12 +1527,12 @@ messages.getDialogFilters#f19ed96d = Vector; messages.getSuggestedDialogFilters#a29cd42c = Vector; messages.updateDialogFilter#1ad4a04a flags:# id:int filter:flags.0?DialogFilter = Bool; messages.updateDialogFiltersOrder#c563c1e4 order:Vector = Bool; -messages.getOldFeaturedStickers#5fe7025b offset:int limit:int hash:int = messages.FeaturedStickers; -messages.getReplies#24b581ba peer:InputPeer msg_id:int offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages; +messages.getOldFeaturedStickers#7ed094a1 offset:int limit:int hash:long = messages.FeaturedStickers; +messages.getReplies#22ddd30c peer:InputPeer msg_id:int offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages; messages.getDiscussionMessage#446972fd peer:InputPeer msg_id:int = messages.DiscussionMessage; messages.readDiscussion#f731a9f4 peer:InputPeer msg_id:int read_max_id:int = Bool; messages.unpinAllMessages#f025bc8b peer:InputPeer = messages.AffectedHistory; -messages.deleteChat#83247d11 chat_id:int = Bool; +messages.deleteChat#5bd0ee50 chat_id:long = Bool; messages.deletePhoneCallHistory#f9cbe409 flags:# revoke:flags.0?true = messages.AffectedFoundMessages; messages.checkHistoryImport#43fe19f3 import_head:string = messages.HistoryImportParsed; messages.initHistoryImport#34090c3b peer:InputPeer file:InputFile media_count:int = messages.HistoryImport; @@ -1546,6 +1548,7 @@ messages.getChatInviteImporters#26fb7289 peer:InputPeer link:string offset_date: messages.setHistoryTTL#b80e5fe4 peer:InputPeer period:int = Updates; messages.checkHistoryImportPeer#5dc60f03 peer:InputPeer = messages.CheckedHistoryImportPeer; messages.setChatTheme#e63be13f peer:InputPeer emoticon:string = Updates; +messages.getMessageReadParticipants#2c6f97b7 peer:InputPeer msg_id:int = Vector; updates.getState#edd4882a = updates.State; updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference; @@ -1593,7 +1596,7 @@ channels.deleteMessages#84c1fd4e channel:InputChannel id:Vector = messages. channels.deleteUserHistory#d10dd71b channel:InputChannel user_id:InputUser = messages.AffectedHistory; channels.reportSpam#fe087810 channel:InputChannel user_id:InputUser id:Vector = Bool; channels.getMessages#ad8c9a23 channel:InputChannel id:Vector = messages.Messages; -channels.getParticipants#123e05e9 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:int = channels.ChannelParticipants; +channels.getParticipants#77ced9d0 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:long = channels.ChannelParticipants; channels.getParticipant#a0ab6cc6 channel:InputChannel participant:InputPeer = channels.ChannelParticipant; channels.getChannels#a7f6bbb id:Vector = messages.Chats; channels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull; @@ -1693,4 +1696,4 @@ stats.getMegagroupStats#dcdf8607 flags:# dark:flags.0?true channel:InputChannel stats.getMessagePublicForwards#5630281b channel:InputChannel msg_id:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages; stats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats; -// LAYER 132 +// LAYER 133 diff --git a/Telegram/SourceFiles/api/api_hash.cpp b/Telegram/SourceFiles/api/api_hash.cpp index 75ee587aac..be5f9277c2 100644 --- a/Telegram/SourceFiles/api/api_hash.cpp +++ b/Telegram/SourceFiles/api/api_hash.cpp @@ -15,7 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace Api { namespace { -[[nodiscard]] int32 CountDocumentVectorHash( +[[nodiscard]] uint64 CountDocumentVectorHash( const QVector vector) { auto result = HashInit(); for (const auto document : vector) { @@ -24,7 +24,7 @@ namespace { return HashFinalize(result); } -[[nodiscard]] int32 CountSpecialStickerSetHash( +[[nodiscard]] uint64 CountSpecialStickerSetHash( not_null session, uint64 setId) { const auto &sets = session->data().stickers().sets(); @@ -35,16 +35,14 @@ namespace { return 0; } -} // namespace - -int32 CountStickersHash( +[[nodiscard]] uint64 CountStickersOrderHash( not_null session, + const Data::StickersSetsOrder &order, bool checkOutdatedInfo) { using Flag = Data::StickersSetFlag; auto result = HashInit(); bool foundOutdated = false; const auto &sets = session->data().stickers().sets(); - const auto &order = session->data().stickers().setsOrder(); for (auto i = order.cbegin(), e = order.cend(); i != e; ++i) { auto it = sets.find(*i); if (it != sets.cend()) { @@ -62,7 +60,27 @@ int32 CountStickersHash( : 0; } -int32 CountRecentStickersHash( +} // namespace + +uint64 CountStickersHash( + not_null session, + bool checkOutdatedInfo) { + return CountStickersOrderHash( + session, + session->data().stickers().setsOrder(), + checkOutdatedInfo); +} + +uint64 CountMasksHash( + not_null session, + bool checkOutdatedInfo) { + return CountStickersOrderHash( + session, + session->data().stickers().maskSetsOrder(), + checkOutdatedInfo); +} + +uint64 CountRecentStickersHash( not_null session, bool attached) { return CountSpecialStickerSetHash( @@ -72,11 +90,11 @@ int32 CountRecentStickersHash( : Data::Stickers::CloudRecentSetId); } -int32 CountFavedStickersHash(not_null session) { +uint64 CountFavedStickersHash(not_null session) { return CountSpecialStickerSetHash(session, Data::Stickers::FavedSetId); } -int32 CountFeaturedStickersHash(not_null session) { +uint64 CountFeaturedStickersHash(not_null session) { auto result = HashInit(); const auto &sets = session->data().stickers().sets(); const auto &featured = session->data().stickers().featuredSetsOrder(); @@ -92,7 +110,7 @@ int32 CountFeaturedStickersHash(not_null session) { return HashFinalize(result); } -int32 CountSavedGifsHash(not_null session) { +uint64 CountSavedGifsHash(not_null session) { return CountDocumentVectorHash(session->data().stickers().savedGifs()); } diff --git a/Telegram/SourceFiles/api/api_hash.h b/Telegram/SourceFiles/api/api_hash.h index d5fa2588a5..81c9902a22 100644 --- a/Telegram/SourceFiles/api/api_hash.h +++ b/Telegram/SourceFiles/api/api_hash.h @@ -13,40 +13,49 @@ class Session; namespace Api { -[[nodiscard]] int32 CountStickersHash( +[[nodiscard]] uint64 CountStickersHash( not_null session, bool checkOutdatedInfo = false); -[[nodiscard]] int32 CountRecentStickersHash( +[[nodiscard]] uint64 CountMasksHash( + not_null session, + bool checkOutdatedInfo = false); +[[nodiscard]] uint64 CountRecentStickersHash( not_null session, bool attached = false); -[[nodiscard]] int32 CountFavedStickersHash(not_null session); -[[nodiscard]] int32 CountFeaturedStickersHash( +[[nodiscard]] uint64 CountFavedStickersHash(not_null session); +[[nodiscard]] uint64 CountFeaturedStickersHash( not_null session); -[[nodiscard]] int32 CountSavedGifsHash(not_null session); +[[nodiscard]] uint64 CountSavedGifsHash(not_null session); -[[nodiscard]] inline uint32 HashInit() { +[[nodiscard]] inline uint64 HashInit() { return 0; } -inline void HashUpdate(uint32 &already, uint32 value) { - already = (already * 20261) + uint32(value); +inline void HashUpdate(uint64 &already, uint64 value) { + already ^= (already >> 21); + already ^= (already << 35); + already ^= (already >> 4); + already += value; } -inline void HashUpdate(uint32 &already, int32 value) { - HashUpdate(already, uint32(value)); +inline void HashUpdate(uint64 &already, int64 value) { + HashUpdate(already, uint64(value)); } -inline void HashUpdate(uint32 &already, uint64 value) { - HashUpdate(already, uint32(value >> 32)); - HashUpdate(already, uint32(value & 0xFFFFFFFFULL)); +inline void HashUpdate(uint64 &already, uint32 value) { + HashUpdate(already, uint64(value)); } -[[nodiscard]] inline int32 HashFinalize(uint32 already) { - return int32(already & 0x7FFFFFFF); +inline void HashUpdate(uint64 &already, int32 value) { + HashUpdate(already, int64(value)); +} + +[[nodiscard]] inline uint64 HashFinalize(uint64 already) { + return already; } template -[[nodiscard]] inline int32 CountHash(IntRange &&range) { +[[nodiscard]] inline uint64 CountHash(IntRange &&range) { auto result = HashInit(); for (const auto value : range) { HashUpdate(result, value); diff --git a/Telegram/SourceFiles/api/api_sending.cpp b/Telegram/SourceFiles/api/api_sending.cpp index 52a041a647..77a4c6eaea 100644 --- a/Telegram/SourceFiles/api/api_sending.cpp +++ b/Telegram/SourceFiles/api/api_sending.cpp @@ -438,7 +438,7 @@ void SendConfirmedFile( peerToMTP(messageFromId), peerToMTP(file->to.peer), MTPMessageFwdHeader(), - MTPint(), + MTPlong(), // via_bot_id replyHeader, MTP_int(HistoryItem::NewMessageDate(file->to.options.scheduled)), MTP_string(caption.text), diff --git a/Telegram/SourceFiles/api/api_single_message_search.cpp b/Telegram/SourceFiles/api/api_single_message_search.cpp index c6d6e146d3..781a1740a5 100644 --- a/Telegram/SourceFiles/api/api_single_message_search.cpp +++ b/Telegram/SourceFiles/api/api_single_message_search.cpp @@ -142,7 +142,7 @@ std::optional SingleMessageSearch::performLookupById( _requestId = _session->api().request(MTPchannels_GetChannels( MTP_vector( 1, - MTP_inputChannel(MTP_int(channelId.bare), MTP_long(0))) // #TODO ids + MTP_inputChannel(MTP_long(channelId.bare), MTP_long(0))) )).done([=](const MTPmessages_Chats &result) { result.match([&](const auto &data) { const auto peer = _session->data().processChats(data.vchats()); diff --git a/Telegram/SourceFiles/api/api_text_entities.cpp b/Telegram/SourceFiles/api/api_text_entities.cpp index 1df8e4fa04..ac5d44aa2a 100644 --- a/Telegram/SourceFiles/api/api_text_entities.cpp +++ b/Telegram/SourceFiles/api/api_text_entities.cpp @@ -116,7 +116,7 @@ MTPVector EntitiesToMTP( if (session && fields.userId == session->userId().bare) { return MTP_inputUserSelf(); } else if (fields.userId) { - return MTP_inputUser(MTP_int(fields.userId), MTP_long(fields.accessHash)); + return MTP_inputUser(MTP_long(fields.userId), MTP_long(fields.accessHash)); } return MTP_inputUserEmpty(); }(entity.data()); diff --git a/Telegram/SourceFiles/api/api_updates.cpp b/Telegram/SourceFiles/api/api_updates.cpp index 7cb1347d53..dfc8cea8b9 100644 --- a/Telegram/SourceFiles/api/api_updates.cpp +++ b/Telegram/SourceFiles/api/api_updates.cpp @@ -1041,7 +1041,7 @@ void Updates::applyUpdatesNoPtsCheck(const MTPUpdates &updates) { : MTP_peerUser(d.vuser_id())), MTP_peerUser(d.vuser_id()), d.vfwd_from() ? *d.vfwd_from() : MTPMessageFwdHeader(), - MTP_int(d.vvia_bot_id().value_or_empty()), + MTP_long(d.vvia_bot_id().value_or_empty()), d.vreply_to() ? *d.vreply_to() : MTPMessageReplyHeader(), d.vdate(), d.vmessage(), @@ -1072,7 +1072,7 @@ void Updates::applyUpdatesNoPtsCheck(const MTPUpdates &updates) { MTP_peerUser(d.vfrom_id()), MTP_peerChat(d.vchat_id()), d.vfwd_from() ? *d.vfwd_from() : MTPMessageFwdHeader(), - MTP_int(d.vvia_bot_id().value_or_empty()), + MTP_long(d.vvia_bot_id().value_or_empty()), d.vreply_to() ? *d.vreply_to() : MTPMessageReplyHeader(), d.vdate(), d.vmessage(), @@ -1933,7 +1933,7 @@ void Updates::feedUpdate(const MTPUpdate &update) { case mtpc_updatePrivacy: { auto &d = update.c_updatePrivacy(); - const auto allChatsLoaded = [&](const MTPVector &ids) { + const auto allChatsLoaded = [&](const MTPVector &ids) { for (const auto &chatId : ids.v) { if (!session().data().chatLoaded(chatId) && !session().data().channelLoaded(chatId)) { diff --git a/Telegram/SourceFiles/api/api_user_privacy.cpp b/Telegram/SourceFiles/api/api_user_privacy.cpp index da5f9d1909..d3b075b070 100644 --- a/Telegram/SourceFiles/api/api_user_privacy.cpp +++ b/Telegram/SourceFiles/api/api_user_privacy.cpp @@ -36,7 +36,7 @@ TLInputRules RulesToTL(const UserPrivacy::Rule &rule) { return result; }; const auto collectInputChats = [](const auto &peers) { - auto result = QVector(); // #TODO ids + auto result = QVector(); result.reserve(peers.size()); for (const auto peer : peers) { if (!peer->isUser()) { @@ -59,7 +59,7 @@ TLInputRules RulesToTL(const UserPrivacy::Rule &rule) { if (!chats.empty()) { result.push_back( MTP_inputPrivacyValueAllowChatParticipants( - MTP_vector(chats))); + MTP_vector(chats))); } } if (!rule.ignoreNever) { @@ -73,7 +73,7 @@ TLInputRules RulesToTL(const UserPrivacy::Rule &rule) { if (!chats.empty()) { result.push_back( MTP_inputPrivacyValueDisallowChatParticipants( - MTP_vector(chats))); + MTP_vector(chats))); } } result.push_back([&] { diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 828ca3b6d6..f170b2c487 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -106,7 +106,7 @@ constexpr auto kUnreadMentionsNextRequestLimit = 100; constexpr auto kSharedMediaLimit = 100; constexpr auto kReadFeaturedSetsTimeout = crl::time(1000); constexpr auto kFileLoaderQueueStopTimeout = crl::time(5000); -constexpr auto kStickersByEmojiInvalidateTimeout = crl::time(60 * 60 * 1000); +constexpr auto kStickersByEmojiInvalidateTimeout = crl::time(6 * 1000); constexpr auto kNotifySettingSaveTimeout = crl::time(1000); constexpr auto kDialogsFirstLoad = 20; constexpr auto kDialogsPerPage = 500; @@ -738,7 +738,7 @@ void ApiWrap::requestContacts() { return; } _contactsRequestId = request(MTPcontacts_GetContacts( - MTP_int(0) + MTP_long(0) // hash )).done([=](const MTPcontacts_Contacts &result) { _contactsRequestId = 0; if (result.type() == mtpc_contacts_contactsNotModified) { @@ -782,7 +782,7 @@ void ApiWrap::requestMoreDialogs(Data::Folder *folder) { const auto loadCount = firstLoad ? kDialogsFirstLoad : kDialogsPerPage; const auto flags = MTPmessages_GetDialogs::Flag::f_exclude_pinned | MTPmessages_GetDialogs::Flag::f_folder_id; - const auto hash = 0; + const auto hash = uint64(0); state->requestId = request(MTPmessages_GetDialogs( MTP_flags(flags), MTP_int(folder ? folder->id() : 0), @@ -792,7 +792,7 @@ void ApiWrap::requestMoreDialogs(Data::Folder *folder) { ? state->offsetPeer->input : MTP_inputPeerEmpty()), MTP_int(loadCount), - MTP_int(hash) + MTP_long(hash) )).done([=](const MTPmessages_Dialogs &result) { const auto state = dialogsLoadState(folder); const auto count = result.match([]( @@ -1174,7 +1174,7 @@ void ApiWrap::requestPeer(not_null peer) { }).fail(failHandler).send(); } else if (const auto chat = peer->asChat()) { return request(MTPmessages_GetChats( - MTP_vector(1, chat->inputChat) + MTP_vector(1, chat->inputChat) )).done(chatHandler).fail(failHandler).send(); } else if (const auto channel = peer->asChannel()) { return request(MTPchannels_GetChannels( @@ -1350,7 +1350,7 @@ void ApiWrap::markMediaRead(not_null item) { } void ApiWrap::requestPeers(const QList &peers) { - QVector chats; + QVector chats; QVector channels; QVector users; chats.reserve(peers.size()); @@ -1377,7 +1377,7 @@ void ApiWrap::requestPeers(const QList &peers) { }; if (!chats.isEmpty()) { request(MTPmessages_GetChats( - MTP_vector(chats) + MTP_vector(chats) )).done(handleChats).send(); } if (!channels.isEmpty()) { @@ -1401,13 +1401,13 @@ void ApiWrap::requestLastParticipants(not_null channel) { } const auto offset = 0; - const auto participantsHash = 0; + const auto participantsHash = uint64(0); const auto requestId = request(MTPchannels_GetParticipants( channel->inputChannel, MTP_channelParticipantsRecent(), MTP_int(offset), MTP_int(_session->serverConfig().chatSizeMax), - MTP_int(participantsHash) + MTP_long(participantsHash) )).done([=](const MTPchannels_ChannelParticipants &result) { _participantsRequests.remove(channel); parseChannelParticipants(channel, result, [&]( @@ -1430,15 +1430,15 @@ void ApiWrap::requestBots(not_null channel) { return; } - auto offset = 0; - auto participantsHash = 0; - auto requestId = request(MTPchannels_GetParticipants( + const auto offset = 0; + const auto participantsHash = uint64(0); + const auto requestId = request(MTPchannels_GetParticipants( channel->inputChannel, MTP_channelParticipantsBots(), MTP_int(offset), MTP_int(_session->serverConfig().chatSizeMax), - MTP_int(participantsHash) - )).done([this, channel](const MTPchannels_ChannelParticipants &result) { + MTP_long(participantsHash) + )).done([=](const MTPchannels_ChannelParticipants &result) { _botsRequests.remove(channel); parseChannelParticipants(channel, result, [&]( int availableCount, @@ -1448,7 +1448,7 @@ void ApiWrap::requestBots(not_null channel) { availableCount, list); }); - }).fail([this, channel](const MTP::Error &error) { + }).fail([=](const MTP::Error &error) { _botsRequests.remove(channel); }).send(); @@ -1460,22 +1460,22 @@ void ApiWrap::requestAdmins(not_null channel) { return; } - auto offset = 0; - auto participantsHash = 0; - auto requestId = request(MTPchannels_GetParticipants( + const auto offset = 0; + const auto participantsHash = uint64(0); + const auto requestId = request(MTPchannels_GetParticipants( channel->inputChannel, MTP_channelParticipantsAdmins(), MTP_int(offset), MTP_int(_session->serverConfig().chatSizeMax), - MTP_int(participantsHash) - )).done([this, channel](const MTPchannels_ChannelParticipants &result) { + MTP_long(participantsHash) + )).done([=](const MTPchannels_ChannelParticipants &result) { _adminsRequests.remove(channel); result.match([&](const MTPDchannels_channelParticipants &data) { Data::ApplyMegagroupAdmins(channel, data); }, [&](const MTPDchannels_channelParticipantsNotModified &) { LOG(("API Error: channels.channelParticipantsNotModified received!")); }); - }).fail([this, channel](const MTP::Error &error) { + }).fail([=](const MTP::Error &error) { _adminsRequests.remove(channel); }).send(); @@ -1794,8 +1794,8 @@ void ApiWrap::requestChannelMembersForAdd( } request(base::take(_channelMembersForAddRequestId)).cancel(); - auto offset = 0; - auto participantsHash = 0; + const auto offset = 0; + const auto participantsHash = uint64(0); _channelMembersForAdd = channel; _channelMembersForAddRequestId = request(MTPchannels_GetParticipants( @@ -1803,12 +1803,12 @@ void ApiWrap::requestChannelMembersForAdd( MTP_channelParticipantsRecent(), MTP_int(offset), MTP_int(_session->serverConfig().chatSizeMax), - MTP_int(participantsHash) - )).done([this](const MTPchannels_ChannelParticipants &result) { + MTP_long(participantsHash) + )).done([=](const MTPchannels_ChannelParticipants &result) { base::take(_channelMembersForAddRequestId); base::take(_channelMembersForAdd); base::take(_channelMembersForAddCallback)(result); - }).fail([this](const MTP::Error &error) { + }).fail([=](const MTP::Error &error) { base::take(_channelMembersForAddRequestId); base::take(_channelMembersForAdd); base::take(_channelMembersForAddCallback); @@ -2818,10 +2818,10 @@ void ApiWrap::refreshFileReference( MTP_flags(isRecentAttached ? MTPmessages_GetRecentStickers::Flag::f_attached : MTPmessages_GetRecentStickers::Flags(0)), - MTP_int(0)), + MTP_long(0)), std::move(done)); } else if (data.setId == Data::Stickers::FavedSetId) { - request(MTPmessages_GetFavedStickers(MTP_int(0)), + request(MTPmessages_GetFavedStickers(MTP_long(0)), [=] { crl::on_main(_session, [=] { local().writeFavedStickers(); }); }); } else { request(MTPmessages_GetStickerSet( @@ -2836,7 +2836,7 @@ void ApiWrap::refreshFileReference( } }, [&](Data::FileOriginSavedGifs data) { request( - MTPmessages_GetSavedGifs(MTP_int(0)), + MTPmessages_GetSavedGifs(MTP_long(0)), [=] { crl::on_main(_session, [=] { local().writeSavedGifs(); }); }); }, [&](Data::FileOriginWallpaper data) { const auto useSlug = data.ownerId @@ -2886,7 +2886,7 @@ void ApiWrap::updateStickers() { void ApiWrap::updateMasks() { const auto now = crl::now(); - requestStickers(now, true); + requestMasks(now); requestRecentStickers(now, true); } @@ -2922,10 +2922,10 @@ std::vector> *ApiWrap::stickersByEmoji( if (sendRequest) { const auto hash = (it != _stickersByEmoji.end()) ? it->second.hash - : int32(0); + : uint64(0); request(MTPmessages_GetStickers( MTP_string(emoji->text()), - MTP_int(hash) + MTP_long(hash) )).done([=](const MTPmessages_Stickers &result) { if (result.type() == mtpc_messages_stickersNotModified) { return; @@ -2955,51 +2955,52 @@ std::vector> *ApiWrap::stickersByEmoji( return nullptr; } -void ApiWrap::requestStickers(TimeId now, bool masks) { - const auto requestId = [=]() -> mtpRequestId & { - return masks - ? _masksUpdateRequest - : _stickersUpdateRequest; - }; - const auto needed = masks - ? _session->data().stickers().masksUpdateNeeded(now) - : _session->data().stickers().updateNeeded(now); - if (!needed || requestId()) { +void ApiWrap::requestStickers(TimeId now) { + if (!_session->data().stickers().updateNeeded(now) + || _stickersUpdateRequest) { return; } - const auto onDone = [=](const MTPmessages_AllStickers &result) { - if (masks) { - _session->data().stickers().setLastMasksUpdate(crl::now()); - } else { - _session->data().stickers().setLastUpdate(crl::now()); - } - requestId() = 0; + const auto done = [=](const MTPmessages_AllStickers &result) { + _session->data().stickers().setLastUpdate(crl::now()); + _stickersUpdateRequest = 0; - switch (result.type()) { - case mtpc_messages_allStickersNotModified: return; - case mtpc_messages_getMaskStickers: - case mtpc_messages_allStickers: { - auto &d = result.c_messages_allStickers(); + result.match([&](const MTPDmessages_allStickersNotModified&) { + }, [&](const MTPDmessages_allStickers &data) { _session->data().stickers().setsReceived( - d.vsets().v, - d.vhash().v); - } return; - default: Unexpected("Type in ApiWrap::stickersDone()"); - } + data.vsets().v, + data.vhash().v); + }); }; - const auto onFail = [=](const MTP::Error &error) { - LOG(("App Fail: Failed to get %1!" - ).arg(masks ? "masks" : "stickers")); - onDone(MTP_messages_allStickersNotModified()); + _stickersUpdateRequest = request(MTPmessages_GetAllStickers( + MTP_long(Api::CountStickersHash(_session, true)) + )).done(done).fail([=](const MTP::Error &error) { + LOG(("App Fail: Failed to get stickers!")); + done(MTP_messages_allStickersNotModified()); + }).send(); +} + +void ApiWrap::requestMasks(TimeId now) { + if (!_session->data().stickers().masksUpdateNeeded(now) + || _masksUpdateRequest) { + return; + } + const auto done = [=](const MTPmessages_AllStickers &result) { + _session->data().stickers().setLastMasksUpdate(crl::now()); + _masksUpdateRequest = 0; + + result.match([&](const MTPDmessages_allStickersNotModified&) { + }, [&](const MTPDmessages_allStickers &data) { + _session->data().stickers().masksReceived( + data.vsets().v, + data.vhash().v); + }); }; - auto hash = MTP_int(Api::CountStickersHash(_session, true)); - requestId() = masks - ? request(MTPmessages_GetMaskStickers( - std::move(hash)) - ).done(onDone).fail(onFail).send() - : request(MTPmessages_GetAllStickers( - std::move(hash)) - ).done(onDone).fail(onFail).send(); + _masksUpdateRequest = request(MTPmessages_GetMaskStickers( + MTP_long(Api::CountMasksHash(_session, true)) + )).done(done).fail([=](const MTP::Error &error) { + LOG(("App Fail: Failed to get masks!")); + done(MTP_messages_allStickersNotModified()); + }).send(); } void ApiWrap::requestRecentStickers(TimeId now, bool attached) { @@ -3013,7 +3014,7 @@ void ApiWrap::requestRecentStickers(TimeId now, bool attached) { Api::CountRecentStickersHash(_session, attached), attached); } -void ApiWrap::requestRecentStickersWithHash(int32 hash, bool attached) { +void ApiWrap::requestRecentStickersWithHash(uint64 hash, bool attached) { const auto requestId = [=]() -> mtpRequestId & { return attached ? _recentAttachedStickersUpdateRequest @@ -3036,7 +3037,7 @@ void ApiWrap::requestRecentStickersWithHash(int32 hash, bool attached) { : MTPmessages_getRecentStickers::Flags(0); requestId() = request(MTPmessages_GetRecentStickers( MTP_flags(flags), - MTP_int(hash) + MTP_long(hash) )).done([=](const MTPmessages_RecentStickers &result) { finish(); @@ -3069,7 +3070,7 @@ void ApiWrap::requestFavedStickers(TimeId now) { return; } _favedStickersUpdateRequest = request(MTPmessages_GetFavedStickers( - MTP_int(Api::CountFavedStickersHash(_session)) + MTP_long(Api::CountFavedStickersHash(_session)) )).done([=](const MTPmessages_FavedStickers &result) { _session->data().stickers().setLastFavedUpdate(crl::now()); _favedStickersUpdateRequest = 0; @@ -3101,7 +3102,7 @@ void ApiWrap::requestFeaturedStickers(TimeId now) { return; } _featuredStickersUpdateRequest = request(MTPmessages_GetFeaturedStickers( - MTP_int(Api::CountFeaturedStickersHash(_session)) + MTP_long(Api::CountFeaturedStickersHash(_session)) )).done([=](const MTPmessages_FeaturedStickers &result) { _session->data().stickers().setLastFeaturedUpdate(crl::now()); _featuredStickersUpdateRequest = 0; @@ -3131,7 +3132,7 @@ void ApiWrap::requestSavedGifs(TimeId now) { return; } _savedGifsUpdateRequest = request(MTPmessages_GetSavedGifs( - MTP_int(Api::CountSavedGifsHash(_session)) + MTP_long(Api::CountSavedGifsHash(_session)) )).done([=](const MTPmessages_SavedGifs &result) { _session->data().stickers().setLastSavedGifsUpdate(crl::now()); _savedGifsUpdateRequest = 0; @@ -3286,13 +3287,13 @@ void ApiWrap::requestMessageAfterDate( // API returns a message with date <= offset_date. // So we request a message with offset_date = desired_date - 1 and add_offset = -1. // This should give us the first message with date >= desired_date. - auto offsetId = 0; - auto offsetDate = static_cast(base::QDateToDateTime(date).toTime_t()) - 1; - auto addOffset = -1; - auto limit = 1; - auto maxId = 0; - auto minId = 0; - auto historyHash = 0; + const auto offsetId = 0; + const auto offsetDate = static_cast(base::QDateToDateTime(date).toTime_t()) - 1; + const auto addOffset = -1; + const auto limit = 1; + const auto maxId = 0; + const auto minId = 0; + const auto historyHash = uint64(0); request(MTPmessages_GetHistory( peer->input, MTP_int(offsetId), @@ -3301,7 +3302,7 @@ void ApiWrap::requestMessageAfterDate( MTP_int(limit), MTP_int(maxId), MTP_int(minId), - MTP_int(historyHash) + MTP_long(historyHash) )).done([ =, callback = std::forward(callback) @@ -3833,7 +3834,7 @@ void ApiWrap::sendSharedContact( MTP_string(firstName), MTP_string(lastName), MTP_string(), // vcard - MTP_int(userId.bare)), // #TODO ids + MTP_long(userId.bare)), MTPReplyMarkup()); const auto media = MTP_inputMediaContact( diff --git a/Telegram/SourceFiles/apiwrap.h b/Telegram/SourceFiles/apiwrap.h index ba1cdb8480..9c9aa45803 100644 --- a/Telegram/SourceFiles/apiwrap.h +++ b/Telegram/SourceFiles/apiwrap.h @@ -426,7 +426,7 @@ private: struct StickersByEmoji { std::vector> list; - int32 hash = 0; + uint64 hash = 0; crl::time received = 0; }; @@ -490,9 +490,10 @@ private: mtpRequestId req); void gotStickerSet(uint64 setId, const MTPmessages_StickerSet &result); - void requestStickers(TimeId now, bool masks = false); + void requestStickers(TimeId now); + void requestMasks(TimeId now); void requestRecentStickers(TimeId now, bool attached = false); - void requestRecentStickersWithHash(int32 hash, bool attached = false); + void requestRecentStickersWithHash(uint64 hash, bool attached = false); void requestFavedStickers(TimeId now); void requestFeaturedStickers(TimeId now); void requestSavedGifs(TimeId now); diff --git a/Telegram/SourceFiles/boxes/background_box.cpp b/Telegram/SourceFiles/boxes/background_box.cpp index e514f2f7d4..da9c519047 100644 --- a/Telegram/SourceFiles/boxes/background_box.cpp +++ b/Telegram/SourceFiles/boxes/background_box.cpp @@ -224,7 +224,7 @@ BackgroundBox::Inner::Inner( void BackgroundBox::Inner::requestPapers() { _api.request(MTPaccount_GetWallPapers( - MTP_int(_session->data().wallpapersHash()) + MTP_long(_session->data().wallpapersHash()) )).done([=](const MTPaccount_WallPapers &result) { if (_session->data().updateWallpapers(result)) { updatePapers(); diff --git a/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp b/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp index 2222c232d6..2f67828646 100644 --- a/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp @@ -451,7 +451,7 @@ void AddSpecialBoxController::loadMoreRows() { const auto perPage = (_offset > 0) ? kParticipantsPerPage : kParticipantsFirstPageCount; - const auto participantsHash = 0; + const auto participantsHash = uint64(0); const auto channel = _peer->asChannel(); _loadRequestId = _api.request(MTPchannels_GetParticipants( @@ -459,7 +459,7 @@ void AddSpecialBoxController::loadMoreRows() { MTP_channelParticipantsRecent(), MTP_int(_offset), MTP_int(perPage), - MTP_int(participantsHash) + MTP_long(participantsHash) )).done([=](const MTPchannels_ChannelParticipants &result) { _loadRequestId = 0; auto &session = channel->session(); @@ -676,7 +676,7 @@ void AddSpecialBoxController::editAdminDone( MTP_flags(Flag::f_can_edit | (rank.isEmpty() ? Flag(0) : Flag::f_rank)), peerToBareMTPInt(user->id), - MTPint(), // inviter_id + MTPlong(), // inviter_id peerToBareMTPInt(alreadyPromotedBy ? alreadyPromotedBy->id : user->session().userPeerId()), @@ -981,7 +981,7 @@ void AddSpecialBoxSearchController::requestParticipants() { // (because we've waited for search request by timer already, // so we don't expect it to be fast, but we want to fill cache). const auto perPage = kParticipantsPerPage; - const auto participantsHash = 0; + const auto participantsHash = uint64(0); const auto channel = _peer->asChannel(); _requestId = _api.request(MTPchannels_GetParticipants( @@ -989,7 +989,7 @@ void AddSpecialBoxSearchController::requestParticipants() { MTP_channelParticipantsSearch(MTP_string(_query)), MTP_int(_offset), MTP_int(perPage), - MTP_int(participantsHash) + MTP_long(participantsHash) )).done([=]( const MTPchannels_ChannelParticipants &result, mtpRequestId requestId) { diff --git a/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp index 7c4b41c5e5..98bda8b542 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp @@ -644,7 +644,7 @@ UserData *ParticipantsAdditionalData::applyAdmin( return user; } -UserData *ParticipantsAdditionalData::applyRegular(MTPint userId) { +UserData *ParticipantsAdditionalData::applyRegular(MTPlong userId) { const auto user = _peer->owner().userLoaded(userId); if (!user) { return nullptr; @@ -1309,14 +1309,14 @@ void ParticipantsBoxController::loadMoreRows() { const auto perPage = (_offset > 0) ? kParticipantsPerPage : kParticipantsFirstPageCount; - const auto participantsHash = 0; + const auto participantsHash = uint64(0); _loadRequestId = _api.request(MTPchannels_GetParticipants( channel->inputChannel, filter, MTP_int(_offset), MTP_int(perPage), - MTP_int(participantsHash) + MTP_long(participantsHash) )).done([=](const MTPchannels_ChannelParticipants &result) { const auto firstLoad = !_offset; _loadRequestId = 0; @@ -1575,7 +1575,7 @@ void ParticipantsBoxController::editAdminDone( MTP_flags(Flag::f_can_edit | (rank.isEmpty() ? Flag(0) : Flag::f_rank)), peerToBareMTPInt(user->id), - MTPint(), // inviter_id + MTPlong(), // inviter_id peerToBareMTPInt(alreadyPromotedBy ? alreadyPromotedBy->id : user->session().userPeerId()), @@ -1971,9 +1971,9 @@ void ParticipantsBoxController::subscribeToCreatorChange( api->request(MTPchannels_GetParticipants( channel->inputChannel, MTP_channelParticipantsRecent(), - MTP_int(0), + MTP_int(0), // offset MTP_int(channel->session().serverConfig().chatSizeMax), - MTP_int(0) + MTP_long(0) // hash )).done([=](const MTPchannels_ChannelParticipants &result) { if (channel->amCreator()) { channel->mgInfo->creator = channel->session().user().get(); @@ -2100,15 +2100,15 @@ bool ParticipantsBoxSearchController::loadMoreRows() { // For search we request a lot of rows from the first query. // (because we've waited for search request by timer already, // so we don't expect it to be fast, but we want to fill cache). - auto perPage = kParticipantsPerPage; - auto participantsHash = 0; + const auto perPage = kParticipantsPerPage; + const auto participantsHash = uint64(0); _requestId = _api.request(MTPchannels_GetParticipants( _channel->inputChannel, filter, MTP_int(_offset), MTP_int(perPage), - MTP_int(participantsHash) + MTP_long(participantsHash) )).done([=]( const MTPchannels_ChannelParticipants &result, mtpRequestId requestId) { diff --git a/Telegram/SourceFiles/boxes/peers/edit_participants_box.h b/Telegram/SourceFiles/boxes/peers/edit_participants_box.h index d46f762430..feb0e641a1 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_participants_box.h +++ b/Telegram/SourceFiles/boxes/peers/edit_participants_box.h @@ -111,7 +111,7 @@ public: private: UserData *applyCreator(const MTPDchannelParticipantCreator &data); UserData *applyAdmin(const MTPDchannelParticipantAdmin &data); - UserData *applyRegular(MTPint userId); + UserData *applyRegular(MTPlong userId); PeerData *applyBanned(const MTPDchannelParticipantBanned &data); void fillFromChat(not_null chat); void fillFromChannel(not_null channel); diff --git a/Telegram/SourceFiles/boxes/share_box.cpp b/Telegram/SourceFiles/boxes/share_box.cpp index 337aca6620..535772e23f 100644 --- a/Telegram/SourceFiles/boxes/share_box.cpp +++ b/Telegram/SourceFiles/boxes/share_box.cpp @@ -1234,7 +1234,7 @@ void ShareGameScoreByHash( MTP_vector( 1, MTP_inputChannel( - MTP_int(channelId.bare), // #TODO ids + MTP_long(channelId.bare), MTP_long(channelAccessHash))) )).done([=](const MTPmessages_Chats &result) { result.match([&](const auto &data) { diff --git a/Telegram/SourceFiles/boxes/sticker_set_box.cpp b/Telegram/SourceFiles/boxes/sticker_set_box.cpp index 74f37c61db..4a72e18e9f 100644 --- a/Telegram/SourceFiles/boxes/sticker_set_box.cpp +++ b/Telegram/SourceFiles/boxes/sticker_set_box.cpp @@ -125,10 +125,10 @@ private: StickersByEmojiMap _emoji; bool _loaded = false; uint64 _setId = 0; - uint64 _setAccess = 0; + uint64 _setAccessHash = 0; + uint64 _setHash = 0; QString _setTitle, _setShortName; int _setCount = 0; - int32 _setHash = 0; Data::StickersSetFlags _setFlags; TimeId _setInstallDate = TimeId(0); ImageWithLocation _setThumbnail; @@ -350,7 +350,7 @@ StickerSetBox::Inner::Inner( , _controller(controller) , _api(&_controller->session().mtp()) , _setId(set.id) -, _setAccess(set.accessHash) +, _setAccessHash(set.accessHash) , _setShortName(set.shortName) , _pathGradient(std::make_unique( st::windowBgRipple, @@ -419,9 +419,9 @@ void StickerSetBox::Inner::gotSet(const MTPmessages_StickerSet &set) { set); _setShortName = qs(set.vshort_name()); _setId = set.vid().v; - _setAccess = set.vaccess_hash().v; - _setCount = set.vcount().v; + _setAccessHash = set.vaccess_hash().v; _setHash = set.vhash().v; + _setCount = set.vcount().v; _setFlags = Data::ParseStickersSetFlags(set); _setInstallDate = set.vinstalled_date().value_or(0); _setThumbnail = [&] { @@ -513,11 +513,11 @@ void StickerSetBox::Inner::installDone( std::make_unique( &_controller->session().data(), _setId, - _setAccess, + _setAccessHash, + _setHash, _setTitle, _setShortName, _setCount, - _setHash, _setFlags, _setInstallDate)).first; } else { @@ -590,7 +590,7 @@ void StickerSetBox::Inner::mouseMoveEvent(QMouseEvent *e) { if (index >= 0 && index < _pack.size() && index != _previewShown) { _previewShown = index; _controller->widget()->showMediaPreview( - Data::FileOriginStickerSet(_setId, _setAccess), + Data::FileOriginStickerSet(_setId, _setAccessHash), _pack[_previewShown]); } } @@ -651,7 +651,7 @@ void StickerSetBox::Inner::showPreview() { if (index >= 0 && index < _pack.size()) { _previewShown = index; _controller->widget()->showMediaPreview( - Data::FileOriginStickerSet(_setId, _setAccess), + Data::FileOriginStickerSet(_setId, _setAccessHash), _pack[_previewShown]); } } diff --git a/Telegram/SourceFiles/boxes/stickers_box.cpp b/Telegram/SourceFiles/boxes/stickers_box.cpp index 198f41df62..2d8d0dfcb6 100644 --- a/Telegram/SourceFiles/boxes/stickers_box.cpp +++ b/Telegram/SourceFiles/boxes/stickers_box.cpp @@ -434,7 +434,7 @@ void StickersBox::showAttachedStickers() { || (set->flags & SetFlag::NotLoaded)) { session().api().scheduleStickerSetRequest( set->id, - set->access); + set->accessHash); } } } @@ -503,7 +503,7 @@ void StickersBox::getArchivedDone( || (set->flags & SetFlag::NotLoaded)) { session().api().scheduleStickerSetRequest( set->id, - set->access); + set->accessHash); } } } @@ -905,7 +905,9 @@ void StickersBox::requestArchivedSets() { const auto set = it->second.get(); if (set->stickers.isEmpty() && (set->flags & SetFlag::NotLoaded)) { - session().api().scheduleStickerSetRequest(setId, set->access); + session().api().scheduleStickerSetRequest( + setId, + set->accessHash); } } } @@ -1323,7 +1325,7 @@ void StickersBox::Inner::paintRowThumbnail( int left) { const auto origin = Data::FileOriginStickerSet( row->set->id, - row->set->access); + row->set->accessHash); if (row->set->hasThumbnail()) { if (!row->thumbnailMedia) { row->thumbnailMedia = row->set->createThumbnailView(); @@ -2026,14 +2028,17 @@ void StickersBox::Inner::rebuild(bool masks) { if (set->stickers.isEmpty() || (set->flags & SetFlag::NotLoaded)) { - session().api().scheduleStickerSetRequest(set->id, set->access); + session().api().scheduleStickerSetRequest( + set->id, + set->accessHash); } } session().api().requestStickerSets(); updateSize(); } -void StickersBox::Inner::setMegagroupSelectedSet(const StickerSetIdentifier &set) { +void StickersBox::Inner::setMegagroupSelectedSet( + const StickerSetIdentifier &set) { _megagroupSetInput = set; rebuild(false); _scrollsToY.fire(0); diff --git a/Telegram/SourceFiles/calls/calls_box_controller.cpp b/Telegram/SourceFiles/calls/calls_box_controller.cpp index beba2eb45c..4dd8e6351a 100644 --- a/Telegram/SourceFiles/calls/calls_box_controller.cpp +++ b/Telegram/SourceFiles/calls/calls_box_controller.cpp @@ -309,18 +309,18 @@ void BoxController::loadMoreRows() { _loadRequestId = _api.request(MTPmessages_Search( MTP_flags(0), MTP_inputPeerEmpty(), - MTP_string(), + MTP_string(), // q MTP_inputPeerEmpty(), MTPint(), // top_msg_id MTP_inputMessagesFilterPhoneCalls(MTP_flags(0)), - MTP_int(0), - MTP_int(0), + MTP_int(0), // min_date + MTP_int(0), // max_date MTP_int(_offsetId), - MTP_int(0), + MTP_int(0), // add_offset MTP_int(_offsetId ? kFirstPageCount : kPerPageCount), - MTP_int(0), - MTP_int(0), - MTP_int(0) + MTP_int(0), // max_id + MTP_int(0), // min_id + MTP_long(0) // hash )).done([this](const MTPmessages_Messages &result) { _loadRequestId = 0; diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp index 87ed1aa956..f6cd565a96 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp @@ -1061,7 +1061,7 @@ void StickersListWidget::preloadMoreOfficial() { _officialRequestId = _api.request(MTPmessages_GetOldFeaturedStickers( MTP_int(_officialOffset), MTP_int(kOfficialLoadLimit), - MTP_int(0) + MTP_long(0) // hash )).done([=](const MTPmessages_FeaturedStickers &result) { _officialRequestId = 0; result.match([&](const MTPDmessages_featuredStickersNotModified &d) { @@ -1269,14 +1269,14 @@ void StickersListWidget::sendSearchRequest() { } _footer->setLoading(true); - const auto hash = int32(0); + const auto hash = uint64(0); _searchRequestId = _api.request(MTPmessages_SearchStickerSets( MTP_flags(0), MTP_string(_searchQuery), - MTP_int(hash) + MTP_long(hash) )).done([=](const MTPmessages_FoundStickerSets &result) { searchResultsDone(result); - }).fail([this](const MTP::Error &error) { + }).fail([=](const MTP::Error &error) { // show error? _footer->setLoading(false); _searchRequestId = 0; @@ -3191,11 +3191,11 @@ void StickersListWidget::removeSet(uint64 setId) { const auto it = sets.find(_removingSetId); if (it != sets.cend()) { const auto set = it->second.get(); - if (set->id && set->access) { + if (set->id && set->accessHash) { _api.request(MTPmessages_UninstallStickerSet( MTP_inputStickerSetID( MTP_long(set->id), - MTP_long(set->access))) + MTP_long(set->accessHash))) ).send(); } else if (!set->shortName.isEmpty()) { _api.request(MTPmessages_UninstallStickerSet( diff --git a/Telegram/SourceFiles/core/update_checker.cpp b/Telegram/SourceFiles/core/update_checker.cpp index e367086f41..a43979dcd5 100644 --- a/Telegram/SourceFiles/core/update_checker.cpp +++ b/Telegram/SourceFiles/core/update_checker.cpp @@ -945,7 +945,7 @@ void MtpChecker::start() { MTP_int(1), // limit MTP_int(0), // max_id MTP_int(0), // min_id - MTP_int(0)), // hash + MTP_long(0)), // hash [=](const MTPmessages_Messages &result) { gotMessage(result); }, failHandler()); }, [=] { fail(); }); diff --git a/Telegram/SourceFiles/data/data_channel.cpp b/Telegram/SourceFiles/data/data_channel.cpp index b4eec67d8b..1aacac8889 100644 --- a/Telegram/SourceFiles/data/data_channel.cpp +++ b/Telegram/SourceFiles/data/data_channel.cpp @@ -59,7 +59,7 @@ bool MegagroupInfo::updateBotCommands( ChannelData::ChannelData(not_null owner, PeerId id) : PeerData(owner, id) , inputChannel( - MTP_inputChannel(MTP_int(peerToChannel(id).bare), MTP_long(0))) + MTP_inputChannel(MTP_long(peerToChannel(id).bare), MTP_long(0))) , _ptsWaiter(&owner->session().updates()) { _flags.changes( ) | rpl::start_with_next([=](const Flags::Change &change) { @@ -101,8 +101,8 @@ void ChannelData::setName(const QString &newName, const QString &newUsername) { void ChannelData::setAccessHash(uint64 accessHash) { access = accessHash; - input = MTP_inputPeerChannel(MTP_int(peerToChannel(id).bare), MTP_long(accessHash)); // #TODO ids - inputChannel = MTP_inputChannel(MTP_int(peerToChannel(id).bare), MTP_long(accessHash)); + input = MTP_inputPeerChannel(MTP_long(peerToChannel(id).bare), MTP_long(accessHash)); + inputChannel = MTP_inputChannel(MTP_long(peerToChannel(id).bare), MTP_long(accessHash)); } void ChannelData::setInviteLink(const QString &newInviteLink) { @@ -352,7 +352,7 @@ void ChannelData::markForbidden() { MTP_flags(isMegagroup() ? MTPDchannelForbidden::Flag::f_megagroup : MTPDchannelForbidden::Flag::f_broadcast), - MTP_int(peerToChannel(id).bare), + MTP_long(peerToChannel(id).bare), MTP_long(access), MTP_string(name), MTPint())); @@ -593,17 +593,6 @@ void ChannelData::setDefaultRestrictions(ChatRestrictions rights) { session().changes().peerUpdated(this, UpdateFlag::Rights); } -auto ChannelData::applyUpdateVersion(int version) -> UpdateStatus { - if (_version > version) { - return UpdateStatus::TooOld; - } else if (_version + 1 < version) { - session().api().requestPeer(this); - return UpdateStatus::Skipped; - } - setVersion(version); - return UpdateStatus::Good; -} - ChatData *ChannelData::getMigrateFromChat() const { if (const auto info = mgInfo.get()) { return info->getMigrateFromChat(); @@ -755,10 +744,6 @@ void ApplyMigration( void ApplyChannelUpdate( not_null channel, const MTPDupdateChatDefaultBannedRights &update) { - if (channel->applyUpdateVersion(update.vversion().v) - != ChannelData::UpdateStatus::Good) { - return; - } channel->setDefaultRestrictions(Data::ChatBannedRightsFlags( update.vdefault_banned_rights())); } diff --git a/Telegram/SourceFiles/data/data_channel.h b/Telegram/SourceFiles/data/data_channel.h index 34eef9cf4c..adbb3a419c 100644 --- a/Telegram/SourceFiles/data/data_channel.h +++ b/Telegram/SourceFiles/data/data_channel.h @@ -369,19 +369,6 @@ public: } void setAvailableMinId(MsgId availableMinId); - enum class UpdateStatus { - Good, - TooOld, - Skipped, - }; - int version() const { - return _version; - } - void setVersion(int version) { - _version = version; - } - UpdateStatus applyUpdateVersion(int version); - [[nodiscard]] ChatData *getMigrateFromChat() const; void setMigrateFromChat(ChatData *chat); @@ -440,7 +427,6 @@ private: int _restrictedCount = 0; int _kickedCount = 0; MsgId _availableMinId = 0; - int _version = 0; RestrictionFlags _defaultRestrictions; AdminRightFlags _adminRights; diff --git a/Telegram/SourceFiles/data/data_chat.cpp b/Telegram/SourceFiles/data/data_chat.cpp index e54ae6dc7f..0e36047666 100644 --- a/Telegram/SourceFiles/data/data_chat.cpp +++ b/Telegram/SourceFiles/data/data_chat.cpp @@ -25,7 +25,7 @@ using UpdateFlag = Data::PeerUpdate::Flag; ChatData::ChatData(not_null owner, PeerId id) : PeerData(owner, id) -, inputChat(MTP_int(peerToChat(id).bare)) { +, inputChat(MTP_long(peerToChat(id).bare)) { _flags.changes( ) | rpl::start_with_next([=](const Flags::Change &change) { if (change.diff & ChatDataFlag::CallNotEmpty) { diff --git a/Telegram/SourceFiles/data/data_chat.h b/Telegram/SourceFiles/data/data_chat.h index 6583a66e36..d0e6572e24 100644 --- a/Telegram/SourceFiles/data/data_chat.h +++ b/Telegram/SourceFiles/data/data_chat.h @@ -165,7 +165,7 @@ public: } // Still public data members. - const MTPint inputChat; + const MTPlong inputChat; int count = 0; TimeId date = 0; diff --git a/Telegram/SourceFiles/data/data_cloud_themes.cpp b/Telegram/SourceFiles/data/data_cloud_themes.cpp index 6f55e0f218..0bbda52db1 100644 --- a/Telegram/SourceFiles/data/data_cloud_themes.cpp +++ b/Telegram/SourceFiles/data/data_cloud_themes.cpp @@ -65,6 +65,14 @@ CloudTheme CloudTheme::Parse( } return {}; }; + const auto outgoingAccentColor = [&]() -> std::optional { + if (const auto settings = data.vsettings()) { + return settings->match([&](const MTPDthemeSettings &data) { + return MaybeColorFromSerialized(data.voutbox_accent_color()); + }); + } + return {}; + }; const auto basedOnDark = [&] { if (const auto settings = data.vsettings()) { return settings->match([&](const MTPDthemeSettings &data) { @@ -92,6 +100,9 @@ CloudTheme CloudTheme::Parse( .usersCount = data.vinstalls_count().value_or_empty(), .paper = parseSettings ? paper() : std::nullopt, .accentColor = parseSettings ? accentColor() : std::nullopt, + .outgoingAccentColor = (parseSettings + ? outgoingAccentColor() + : std::nullopt), .outgoingMessagesColors = (parseSettings ? outgoingMessagesColors() : std::vector()), @@ -323,7 +334,7 @@ void CloudThemes::refresh() { } _refreshRequestId = _session->api().request(MTPaccount_GetThemes( MTP_string(Format()), - MTP_int(_hash) + MTP_long(_hash) )).done([=](const MTPaccount_Themes &result) { _refreshRequestId = 0; result.match([&](const MTPDaccount_themes &data) { diff --git a/Telegram/SourceFiles/data/data_cloud_themes.h b/Telegram/SourceFiles/data/data_cloud_themes.h index e6e6ae7cb3..b684d76a15 100644 --- a/Telegram/SourceFiles/data/data_cloud_themes.h +++ b/Telegram/SourceFiles/data/data_cloud_themes.h @@ -35,6 +35,7 @@ struct CloudTheme { std::optional paper; std::optional accentColor; + std::optional outgoingAccentColor; std::vector outgoingMessagesColors; bool basedOnDark = false; @@ -118,7 +119,7 @@ private: void parseChatThemes(const QVector &list); const not_null _session; - int32 _hash = 0; + uint64 _hash = 0; mtpRequestId _refreshRequestId = 0; mtpRequestId _resolveRequestId = 0; std::vector _list; diff --git a/Telegram/SourceFiles/data/data_group_call.cpp b/Telegram/SourceFiles/data/data_group_call.cpp index 87daadcce5..b58e0778e3 100644 --- a/Telegram/SourceFiles/data/data_group_call.cpp +++ b/Telegram/SourceFiles/data/data_group_call.cpp @@ -328,7 +328,7 @@ void GroupCall::discard(const MTPDgroupCallDiscarded &data) { Core::App().calls().applyGroupCallUpdateChecked( &peer->session(), MTP_updateGroupCall( - MTP_int(peer->isChat() + MTP_long(peer->isChat() ? peerToChat(peer->id).bare : peerToChannel(peer->id).bare), MTP_groupCallDiscarded( @@ -847,12 +847,12 @@ void GroupCall::requestUnknownParticipants() { for (const auto &[participantPeerId, when] : participantPeerIds) { if (const auto userId = peerToUser(participantPeerId)) { peerInputs.push_back( - MTP_inputPeerUser(MTP_int(userId.bare), MTP_long(0))); // #TODO ids + MTP_inputPeerUser(MTP_long(userId.bare), MTP_long(0))); } else if (const auto chatId = peerToChat(participantPeerId)) { - peerInputs.push_back(MTP_inputPeerChat(MTP_int(chatId.bare))); // #TODO ids + peerInputs.push_back(MTP_inputPeerChat(MTP_long(chatId.bare))); } else if (const auto channelId = peerToChannel(participantPeerId)) { peerInputs.push_back( - MTP_inputPeerChannel(MTP_int(channelId.bare), MTP_long(0))); // #TODO ids + MTP_inputPeerChannel(MTP_long(channelId.bare), MTP_long(0))); } } _unknownParticipantPeersRequestId = api().request( diff --git a/Telegram/SourceFiles/data/data_histories.cpp b/Telegram/SourceFiles/data/data_histories.cpp index 7006565896..ce38067b49 100644 --- a/Telegram/SourceFiles/data/data_histories.cpp +++ b/Telegram/SourceFiles/data/data_histories.cpp @@ -415,13 +415,13 @@ void Histories::requestFakeChatListMessage( sendRequest(history, RequestType::History, [=](Fn finish) { return session().api().request(MTPmessages_GetHistory( history->peer->input, - MTP_int(0), // offset_id - MTP_int(0), // offset_date - MTP_int(0), // add_offset - MTP_int(2), // limit - MTP_int(0), // max_id - MTP_int(0), // min_id - MTP_int(0) + MTP_int(0), // offset_id + MTP_int(0), // offset_date + MTP_int(0), // add_offset + MTP_int(2), // limit + MTP_int(0), // max_id + MTP_int(0), // min_id + MTP_long(0) // hash )).done([=](const MTPmessages_Messages &result) { _fakeChatListRequests.erase(history); history->setFakeChatListMessageFrom(result); diff --git a/Telegram/SourceFiles/data/data_peer_id.cpp b/Telegram/SourceFiles/data/data_peer_id.cpp index c6e1be66af..b6a77237b0 100644 --- a/Telegram/SourceFiles/data/data_peer_id.cpp +++ b/Telegram/SourceFiles/data/data_peer_id.cpp @@ -25,7 +25,7 @@ MTPpeer peerToMTP(PeerId id) { } else if (peerIsChannel(id)) { return MTP_peerChannel(peerToBareMTPInt(id)); } - return MTP_peerUser(MTP_int(0)); + return MTP_peerUser(MTP_long(0)); } PeerId DeserializePeerId(quint64 serialized) { diff --git a/Telegram/SourceFiles/data/data_peer_id.h b/Telegram/SourceFiles/data/data_peer_id.h index 1bebe95c98..5944173d56 100644 --- a/Telegram/SourceFiles/data/data_peer_id.h +++ b/Telegram/SourceFiles/data/data_peer_id.h @@ -25,9 +25,7 @@ struct ChatIdType { //} constexpr ChatIdType(BareId value) noexcept : bare(value) { } - constexpr ChatIdType(int32 value) noexcept : bare(value) { // #TODO ids remove - } - constexpr ChatIdType(MTPint value) noexcept : bare(value.v) { // #TODO ids + constexpr ChatIdType(MTPlong value) noexcept : bare(value.v) { } [[nodiscard]] constexpr explicit operator bool() const noexcept { @@ -263,7 +261,7 @@ bool operator>=(PeerIdZero, PeerId) = delete; return channelId; } -[[nodiscard]] inline constexpr PeerId peerFromUser(MTPint userId) noexcept { // #TODO ids +[[nodiscard]] inline constexpr PeerId peerFromUser(MTPlong userId) noexcept { return peerFromUser(userId.v); } @@ -288,8 +286,8 @@ bool operator>=(PeerIdZero, PeerId) = delete; return id.to(); } -[[nodiscard]] inline MTPint peerToBareMTPInt(PeerId id) { // #TODO ids - return MTP_int(id.value & PeerId::kChatTypeMask); +[[nodiscard]] inline MTPlong peerToBareMTPInt(PeerId id) { + return MTP_long(id.value & PeerId::kChatTypeMask); } [[nodiscard]] PeerId peerFromMTP(const MTPPeer &peer); diff --git a/Telegram/SourceFiles/data/data_poll.cpp b/Telegram/SourceFiles/data/data_poll.cpp index 3680566ee2..3d0e7fa044 100644 --- a/Telegram/SourceFiles/data/data_poll.cpp +++ b/Telegram/SourceFiles/data/data_poll.cpp @@ -141,12 +141,12 @@ bool PollData::applyResults(const MTPPollResults &results) { recent->v, ranges::equal_to(), bareProj, - &MTPint::v); // #TODO ids + &MTPlong::v); if (recentChanged) { changed = true; recentVoters = ranges::views::all( recent->v - ) | ranges::views::transform([&](MTPint userId) { + ) | ranges::views::transform([&](MTPlong userId) { const auto user = _owner->user(userId.v); return user->isMinimalLoaded() ? user.get() : nullptr; }) | ranges::views::filter([](UserData *user) { diff --git a/Telegram/SourceFiles/data/data_replies_list.cpp b/Telegram/SourceFiles/data/data_replies_list.cpp index 7dc9215223..7b0a5639f2 100644 --- a/Telegram/SourceFiles/data/data_replies_list.cpp +++ b/Telegram/SourceFiles/data/data_replies_list.cpp @@ -439,7 +439,7 @@ void RepliesList::loadAround(MsgId id) { MTP_int(kMessagesPerPage), // limit MTP_int(0), // max_id MTP_int(0), // min_id - MTP_int(0) // hash + MTP_long(0) // hash )).done([=](const MTPmessages_Messages &result) { _beforeId = 0; _loadingAround = std::nullopt; @@ -495,7 +495,7 @@ void RepliesList::loadBefore() { MTP_int(kMessagesPerPage), // limit MTP_int(0), // min_id MTP_int(0), // max_id - MTP_int(0) // hash + MTP_long(0) // hash )).done([=](const MTPmessages_Messages &result) { _beforeId = 0; finish(); @@ -539,7 +539,7 @@ void RepliesList::loadAfter() { MTP_int(kMessagesPerPage), // limit MTP_int(0), // min_id MTP_int(0), // max_id - MTP_int(0) // hash + MTP_long(0) // hash )).done([=](const MTPmessages_Messages &result) { _afterId = 0; finish(); diff --git a/Telegram/SourceFiles/data/data_scheduled_messages.cpp b/Telegram/SourceFiles/data/data_scheduled_messages.cpp index 52df0b32c7..a468c76bc1 100644 --- a/Telegram/SourceFiles/data/data_scheduled_messages.cpp +++ b/Telegram/SourceFiles/data/data_scheduled_messages.cpp @@ -57,7 +57,7 @@ MTPMessage PrepareMessage(const MTPMessage &message, MsgId id) { data.vfrom_id() ? *data.vfrom_id() : MTPPeer(), data.vpeer_id(), data.vfwd_from() ? *data.vfwd_from() : MTPMessageFwdHeader(), - MTP_int(data.vvia_bot_id().value_or_empty()), + MTP_long(data.vvia_bot_id().value_or_empty()), data.vreply_to() ? *data.vreply_to() : MTPMessageReplyHeader(), data.vdate(), data.vmessage(), @@ -198,7 +198,7 @@ void ScheduledMessages::sendNowSimpleMessage( peerToMTP(_session->userPeerId()), peerToMTP(history->peer->id), MTPMessageFwdHeader(), - MTPint(), + MTPlong(), // via_bot_id replyHeader, update.vdate(), MTP_string(local->originalText().text), @@ -379,11 +379,13 @@ void ScheduledMessages::request(not_null history) { return; } const auto i = _data.find(history); - const auto hash = (i != end(_data)) ? countListHash(i->second) : 0; + const auto hash = (i != end(_data)) + ? countListHash(i->second) + : uint64(0); request.requestId = _session->api().request( MTPmessages_GetScheduledHistory( history->peer->input, - MTP_int(hash)) + MTP_long(hash)) ).done([=](const MTPmessages_Messages &result) { parse(history, result); }).fail([=](const MTP::Error &error) { @@ -533,7 +535,7 @@ void ScheduledMessages::remove(not_null item) { _updates.fire_copy(history); } -int32 ScheduledMessages::countListHash(const List &list) const { +uint64 ScheduledMessages::countListHash(const List &list) const { using namespace Api; auto hash = HashInit(); @@ -548,7 +550,7 @@ int32 ScheduledMessages::countListHash(const List &list) const { if (const auto edited = item->Get()) { HashUpdate(hash, edited->date); } else { - HashUpdate(hash, int32(0)); + HashUpdate(hash, TimeId(0)); } HashUpdate(hash, item->date()); } diff --git a/Telegram/SourceFiles/data/data_scheduled_messages.h b/Telegram/SourceFiles/data/data_scheduled_messages.h index b6656f23f7..e3d4e27eb4 100644 --- a/Telegram/SourceFiles/data/data_scheduled_messages.h +++ b/Telegram/SourceFiles/data/data_scheduled_messages.h @@ -79,7 +79,7 @@ private: const base::flat_set> &clear); void sort(List &list); void remove(not_null item); - [[nodiscard]] int32 countListHash(const List &list) const; + [[nodiscard]] uint64 countListHash(const List &list) const; void clearOldRequests(); const not_null _session; diff --git a/Telegram/SourceFiles/data/data_search_controller.cpp b/Telegram/SourceFiles/data/data_search_controller.cpp index bc544c8a4c..1bd42b218b 100644 --- a/Telegram/SourceFiles/data/data_search_controller.cpp +++ b/Telegram/SourceFiles/data/data_search_controller.cpp @@ -83,7 +83,7 @@ std::optional PrepareSearchRequest( } Unexpected("Direction in PrepareSearchRequest"); }(); - const auto hash = int32(0); + const auto hash = uint64(0); return MTPmessages_Search( MTP_flags(0), @@ -92,14 +92,14 @@ std::optional PrepareSearchRequest( MTP_inputPeerEmpty(), MTPint(), // top_msg_id filter, - MTP_int(0), - MTP_int(0), + MTP_int(0), // min_date + MTP_int(0), // max_date MTP_int(offsetId), MTP_int(addOffset), MTP_int(limit), MTP_int(maxId), MTP_int(minId), - MTP_int(hash)); + MTP_long(hash)); } SearchResult ParseSearchResult( diff --git a/Telegram/SourceFiles/data/data_session.cpp b/Telegram/SourceFiles/data/data_session.cpp index 137ac67d0a..d8a609fd6f 100644 --- a/Telegram/SourceFiles/data/data_session.cpp +++ b/Telegram/SourceFiles/data/data_session.cpp @@ -712,9 +712,6 @@ not_null Session::processChat(const MTPChat &data) { channel->setAccessHash( data.vaccess_hash().value_or(channel->access)); channel->date = data.vdate().v; - if (channel->version() < data.vversion().v) { - channel->setVersion(data.vversion().v); - } if (const auto restriction = data.vrestriction_reason()) { channel->setUnavailableReasons( ExtractUnavailableReasons(restriction->v)); @@ -856,12 +853,6 @@ void Session::applyMaximumChatVersions(const MTPVector &data) { chat->setVersion(data.vversion().v); } } - }, [&](const MTPDchannel &data) { - if (const auto channel = channelLoaded(data.vid().v)) { - if (data.vversion().v < channel->version()) { - channel->setVersion(data.vversion().v); - } - } }, [](const auto &) { }); } @@ -3921,7 +3912,7 @@ void Session::serviceNotification( | MTPDuser::Flag::f_phone | MTPDuser::Flag::f_status | MTPDuser::Flag::f_verified), - MTP_int(peerToUser(PeerData::kServiceNotificationsId).bare), // #TODO ids + MTP_long(peerToUser(PeerData::kServiceNotificationsId).bare), MTPlong(), // access_hash MTP_string("Telegram"), MTPstring(), // last_name @@ -3962,7 +3953,7 @@ void Session::insertCheckedServiceNotification( peerToMTP(PeerData::kServiceNotificationsId), peerToMTP(PeerData::kServiceNotificationsId), MTPMessageFwdHeader(), - MTPint(), // via_bot_id + MTPlong(), // via_bot_id MTPMessageReplyHeader(), MTP_int(date), MTP_string(sending.text), @@ -4031,7 +4022,7 @@ bool Session::updateWallpapers(const MTPaccount_WallPapers &data) { }); } -void Session::setWallpapers(const QVector &data, int32 hash) { +void Session::setWallpapers(const QVector &data, uint64 hash) { _wallpapersHash = hash; _wallpapers.clear(); @@ -4080,7 +4071,7 @@ const std::vector &Session::wallpapers() const { return _wallpapers; } -int32 Session::wallpapersHash() const { +uint64 Session::wallpapersHash() const { return _wallpapersHash; } diff --git a/Telegram/SourceFiles/data/data_session.h b/Telegram/SourceFiles/data/data_session.h index c0f6f2b670..3818adbb0e 100644 --- a/Telegram/SourceFiles/data/data_session.h +++ b/Telegram/SourceFiles/data/data_session.h @@ -659,7 +659,7 @@ public: bool updateWallpapers(const MTPaccount_WallPapers &data); void removeWallpaper(const WallPaper &paper); const std::vector &wallpapers() const; - int32 wallpapersHash() const; + uint64 wallpapersHash() const; void clearLocalStorage(); @@ -793,7 +793,7 @@ private: const MTPMessageMedia &media, TimeId date); - void setWallpapers(const QVector &data, int32 hash); + void setWallpapers(const QVector &data, uint64 hash); void checkPollsClosings(); @@ -944,7 +944,7 @@ private: std::unique_ptr _passportCredentials; std::vector _wallpapers; - int32 _wallpapersHash = 0; + uint64 _wallpapersHash = 0; Groups _groups; std::unique_ptr _chatsFilters; diff --git a/Telegram/SourceFiles/data/stickers/data_stickers.cpp b/Telegram/SourceFiles/data/stickers/data_stickers.cpp index 0917335b9a..346b685f7c 100644 --- a/Telegram/SourceFiles/data/stickers/data_stickers.cpp +++ b/Telegram/SourceFiles/data/stickers/data_stickers.cpp @@ -126,11 +126,11 @@ void Stickers::incrementSticker(not_null document) { std::make_unique( &session().data(), Data::Stickers::CloudRecentSetId, - uint64(0), + uint64(0), // accessHash + uint64(0), // hash tr::lng_recent_stickers(tr::now), QString(), 0, // count - 0, // hash SetFlag::Special, TimeId(0))).first; } else { @@ -287,7 +287,7 @@ void Stickers::applyArchivedResult( if (setData) { auto set = feedSet(*setData); if (set->stickers.isEmpty()) { - setsToRequest.insert(set->id, set->access); + setsToRequest.insert(set->id, set->accessHash); } const auto masks = !!(set->flags & SetFlag::Masks); (masks ? masksCount : stickersCount)++; @@ -479,11 +479,11 @@ void Stickers::setIsFaved( it = sets.emplace(FavedSetId, std::make_unique( &document->owner(), FavedSetId, - uint64(0), + uint64(0), // accessHash + uint64(0), // hash Lang::Hard::FavedSetTitle(), QString(), 0, // count - 0, // hash SetFlag::Special, TimeId(0))).first; } @@ -564,23 +564,31 @@ void Stickers::setFaved(not_null document, bool faved) { } } -void Stickers::setsReceived(const QVector &data, int32 hash) { - const auto masksReceived = ranges::all_of( - data, - [](const MTPStickerSet &set) { - return set.c_stickerSet().is_masks(); - }); - auto &setsOrder = masksReceived - ? maskSetsOrderRef() - : setsOrderRef(); +void Stickers::setsReceived( + const QVector &data, + uint64 hash) { + setsOrMasksReceived(data, hash, false); +} + +void Stickers::masksReceived( + const QVector &data, + uint64 hash) { + setsOrMasksReceived(data, hash, true); +} + +void Stickers::setsOrMasksReceived( + const QVector &data, + uint64 hash, + bool masks) { + auto &setsOrder = masks ? maskSetsOrderRef() : setsOrderRef(); setsOrder.clear(); auto &sets = setsRef(); QMap setsToRequest; for (auto &[id, set] : sets) { const auto archived = !!(set->flags & SetFlag::Archived); - const auto masks = !!(set->flags & SetFlag::Masks); - if (!archived && (masksReceived == masks)) { + const auto maskset = !!(set->flags & SetFlag::Masks); + if (!archived && (masks == maskset)) { // Mark for removing. set->flags &= ~SetFlag::Installed; set->installDate = 0; @@ -596,7 +604,7 @@ void Stickers::setsReceived(const QVector &data, int32 hash) { setsOrder.push_back(set->id); if (set->stickers.isEmpty() || (set->flags & SetFlag::NotLoaded)) { - setsToRequest.insert(set->id, set->access); + setsToRequest.insert(set->id, set->accessHash); } } } @@ -633,7 +641,7 @@ void Stickers::setsReceived(const QVector &data, int32 hash) { api.requestStickerSets(); } - if (masksReceived) { + if (masks) { session().local().writeInstalledMasks(); } else { session().local().writeInstalledStickers(); @@ -642,9 +650,12 @@ void Stickers::setsReceived(const QVector &data, int32 hash) { session().saveSettings(); } - const auto counted = Api::CountStickersHash(&session()); + const auto counted = masks + ? Api::CountMasksHash(&session()) + : Api::CountStickersHash(&session()); if (counted != hash) { - LOG(("API Error: received stickers hash %1 while counted hash is %2" + LOG(("API Error: received %1 hash %2 while counted hash is %3" + ).arg(masks ? "masks" : "stickers" ).arg(hash ).arg(counted)); } @@ -684,7 +695,7 @@ void Stickers::specialSetReceived( uint64 setId, const QString &setTitle, const QVector &items, - int32 hash, + uint64 hash, const QVector &packs, const QVector &usageDates) { auto &sets = setsRef(); @@ -699,11 +710,11 @@ void Stickers::specialSetReceived( it = sets.emplace(setId, std::make_unique( &owner(), setId, - uint64(0), + uint64(0), // accessHash + uint64(0), // hash setTitle, QString(), 0, // count - 0, // hash SetFlag::Special, TimeId(0))).first; } else { @@ -808,7 +819,7 @@ void Stickers::specialSetReceived( void Stickers::featuredSetsReceived( const QVector &list, const QVector &unread, - int32 hash) { + uint64 hash) { auto &&unreadIds = ranges::views::all( unread ) | ranges::views::transform([](const MTPlong &id) { @@ -861,16 +872,16 @@ void Stickers::featuredSetsReceived( &owner(), data->vid().v, data->vaccess_hash().v, + data->vhash().v, title, qs(data->vshort_name()), data->vcount().v, - data->vhash().v, flags | SetFlag::NotLoaded, installDate)).first; it->second->setThumbnail(thumbnail); } else { const auto set = it->second.get(); - set->access = data->vaccess_hash().v; + set->accessHash = data->vaccess_hash().v; set->title = title; set->shortName = qs(data->vshort_name()); set->flags = flags @@ -929,7 +940,7 @@ void Stickers::featuredSetsReceived( notifyUpdated(); } -void Stickers::gifsReceived(const QVector &items, int32 hash) { +void Stickers::gifsReceived(const QVector &items, uint64 hash) { auto &saved = savedGifsRef(); saved.clear(); @@ -1061,7 +1072,7 @@ std::vector> Stickers::getListByEmoji( } const auto set = it->second.get(); if (set->emoji.isEmpty()) { - setsToRequest.emplace(set->id, set->access); + setsToRequest.emplace(set->id, set->accessHash); set->flags |= SetFlag::NotLoaded; continue; } @@ -1168,16 +1179,16 @@ StickersSet *Stickers::feedSet(const MTPDstickerSet &data) { &owner(), data.vid().v, data.vaccess_hash().v, + data.vhash().v, title, qs(data.vshort_name()), data.vcount().v, - data.vhash().v, flags | SetFlag::NotLoaded, data.vinstalled_date().value_or_empty())).first; it->second->setThumbnail(thumbnail); } else { const auto set = it->second.get(); - set->access = data.vaccess_hash().v; + set->accessHash = data.vaccess_hash().v; set->title = title; set->shortName = qs(data.vshort_name()); oldFlags = set->flags; diff --git a/Telegram/SourceFiles/data/stickers/data_stickers.h b/Telegram/SourceFiles/data/stickers/data_stickers.h index 8a24fa85f3..3550e4a44d 100644 --- a/Telegram/SourceFiles/data/stickers/data_stickers.h +++ b/Telegram/SourceFiles/data/stickers/data_stickers.h @@ -171,25 +171,25 @@ public: void applyArchivedResult( const MTPDmessages_stickerSetInstallResultArchive &d); - bool applyArchivedResultFake(); // For testing. void installLocally(uint64 setId); void undoInstallLocally(uint64 setId); bool isFaved(not_null document); void setFaved(not_null document, bool faved); - void setsReceived(const QVector &data, int32 hash); + void setsReceived(const QVector &data, uint64 hash); + void masksReceived(const QVector &data, uint64 hash); void specialSetReceived( uint64 setId, const QString &setTitle, const QVector &items, - int32 hash, + uint64 hash, const QVector &packs = QVector(), const QVector &usageDates = QVector()); void featuredSetsReceived( const QVector &list, const QVector &unread, - int32 hash); - void gifsReceived(const QVector &items, int32 hash); + uint64 hash); + void gifsReceived(const QVector &items, uint64 hash); std::vector> getListByEmoji( not_null emoji, @@ -228,6 +228,10 @@ private: StickersPack &&pack, const std::vector &&dates, const QVector &packs); + void setsOrMasksReceived( + const QVector &data, + uint64 hash, + bool masks); const not_null _owner; rpl::event_stream<> _updated; diff --git a/Telegram/SourceFiles/data/stickers/data_stickers_set.cpp b/Telegram/SourceFiles/data/stickers/data_stickers_set.cpp index fbabbf5242..56e69bae21 100644 --- a/Telegram/SourceFiles/data/stickers/data_stickers_set.cpp +++ b/Telegram/SourceFiles/data/stickers/data_stickers_set.cpp @@ -55,19 +55,19 @@ StickersSetFlags ParseStickersSetFlags(const MTPDstickerSet &data) { StickersSet::StickersSet( not_null owner, uint64 id, - uint64 access, + uint64 accessHash, + uint64 hash, const QString &title, const QString &shortName, int count, - int32 hash, StickersSetFlags flags, TimeId installDate) : id(id) -, access(access) +, accessHash(accessHash) +, hash(hash) , title(title) , shortName(shortName) , count(count) -, hash(hash) , flags(flags) , installDate(installDate) , _owner(owner) { @@ -82,15 +82,15 @@ Main::Session &StickersSet::session() const { } MTPInputStickerSet StickersSet::mtpInput() const { - return (id && access) - ? MTP_inputStickerSetID(MTP_long(id), MTP_long(access)) + return (id && accessHash) + ? MTP_inputStickerSetID(MTP_long(id), MTP_long(accessHash)) : MTP_inputStickerSetShortName(MTP_string(shortName)); } StickerSetIdentifier StickersSet::identifier() const { return StickerSetIdentifier{ .id = id, - .accessHash = access, + .accessHash = accessHash, }; } @@ -139,7 +139,7 @@ void StickersSet::loadThumbnail() { Data::LoadCloudFile( &_owner->session(), _thumbnail, - Data::FileOriginStickerSet(id, access), + Data::FileOriginStickerSet(id, accessHash), LoadFromCloudOrLocal, autoLoading, Data::kImageCacheTag, diff --git a/Telegram/SourceFiles/data/stickers/data_stickers_set.h b/Telegram/SourceFiles/data/stickers/data_stickers_set.h index 4adf29c57c..7bd0987334 100644 --- a/Telegram/SourceFiles/data/stickers/data_stickers_set.h +++ b/Telegram/SourceFiles/data/stickers/data_stickers_set.h @@ -66,11 +66,11 @@ public: StickersSet( not_null owner, uint64 id, - uint64 access, + uint64 accessHash, + uint64 hash, const QString &title, const QString &shortName, int count, - int32 hash, StickersSetFlags flags, TimeId installDate); @@ -93,10 +93,10 @@ public: [[nodiscard]] std::shared_ptr activeThumbnailView(); uint64 id = 0; - uint64 access = 0; + uint64 accessHash = 0; + uint64 hash = 0; QString title, shortName; int count = 0; - int32 hash = 0; StickersSetFlags flags; TimeId installDate = 0; StickersPack covers; diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp index 853971dbc6..c89491017c 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp @@ -853,14 +853,14 @@ bool Widget::onSearchMessages(bool searchCache) { : MTP_inputPeerEmpty()), MTPint(), // top_msg_id MTP_inputMessagesFilterEmpty(), - MTP_int(0), - MTP_int(0), - MTP_int(0), - MTP_int(0), + MTP_int(0), // min_date + MTP_int(0), // max_date + MTP_int(0), // offset_id + MTP_int(0), // add_offset MTP_int(SearchPerPage), - MTP_int(0), - MTP_int(0), - MTP_int(0) + MTP_int(0), // max_id + MTP_int(0), // min_id + MTP_long(0) // hash )).done([=](const MTPmessages_Messages &result) { _searchInHistoryRequest = 0; searchReceived(type, result, _searchRequest); @@ -1011,14 +1011,14 @@ void Widget::onSearchMore() { : MTP_inputPeerEmpty()), MTPint(), // top_msg_id MTP_inputMessagesFilterEmpty(), - MTP_int(0), - MTP_int(0), + MTP_int(0), // min_date + MTP_int(0), // max_date MTP_int(offsetId), - MTP_int(0), + MTP_int(0), // add_offset MTP_int(SearchPerPage), - MTP_int(0), - MTP_int(0), - MTP_int(0) + MTP_int(0), // max_id + MTP_int(0), // min_id + MTP_long(0) // hash )).done([=](const MTPmessages_Messages &result) { searchReceived(type, result, _searchRequest); _searchInHistoryRequest = 0; @@ -1084,14 +1084,14 @@ void Widget::onSearchMore() { : MTP_inputPeerEmpty()), MTPint(), // top_msg_id MTP_inputMessagesFilterEmpty(), - MTP_int(0), - MTP_int(0), + MTP_int(0), // min_date + MTP_int(0), // max_date MTP_int(offsetMigratedId), - MTP_int(0), + MTP_int(0), // add_offset MTP_int(SearchPerPage), - MTP_int(0), - MTP_int(0), - MTP_int(0) + MTP_int(0), // max_id + MTP_int(0), // min_id + MTP_long(0) // hash )).done([=](const MTPmessages_Messages &result) { searchReceived(type, result, _searchRequest); _searchInHistoryRequest = 0; diff --git a/Telegram/SourceFiles/export/data/export_data_types.cpp b/Telegram/SourceFiles/export/data/export_data_types.cpp index 792a753a49..00057fdf5e 100644 --- a/Telegram/SourceFiles/export/data/export_data_types.cpp +++ b/Telegram/SourceFiles/export/data/export_data_types.cpp @@ -714,20 +714,20 @@ Chat ParseChat(const MTPChat &data) { data.match([&](const MTPDchat &data) { result.bareId = data.vid().v; result.title = ParseString(data.vtitle()); - result.input = MTP_inputPeerChat(MTP_int(result.bareId)); // #TODO ids + result.input = MTP_inputPeerChat(MTP_long(result.bareId)); if (const auto migratedTo = data.vmigrated_to()) { result.migratedToChannelId = migratedTo->match( [](const MTPDinputChannel &data) { return data.vchannel_id().v; - }, [](auto&&) { return 0; }); + }, [](auto&&) { return BareId(); }); } }, [&](const MTPDchatEmpty &data) { result.bareId = data.vid().v; - result.input = MTP_inputPeerChat(MTP_int(result.bareId)); // #TODO ids + result.input = MTP_inputPeerChat(MTP_long(result.bareId)); }, [&](const MTPDchatForbidden &data) { result.bareId = data.vid().v; result.title = ParseString(data.vtitle()); - result.input = MTP_inputPeerChat(MTP_int(result.bareId)); // #TODO ids + result.input = MTP_inputPeerChat(MTP_long(result.bareId)); }, [&](const MTPDchannel &data) { result.bareId = data.vid().v; result.isBroadcast = data.is_broadcast(); @@ -737,15 +737,15 @@ Chat ParseChat(const MTPChat &data) { result.username = ParseString(*username); } result.input = MTP_inputPeerChannel( - MTP_int(result.bareId), // #TODO ids + MTP_long(result.bareId), MTP_long(data.vaccess_hash().value_or_empty())); }, [&](const MTPDchannelForbidden &data) { result.bareId = data.vid().v; result.isBroadcast = data.is_broadcast(); result.isSupergroup = data.is_megagroup(); result.title = ParseString(data.vtitle()); - result.input = MTP_inputPeerChannel( // #TODO ids - MTP_int(result.bareId), + result.input = MTP_inputPeerChannel( + MTP_long(result.bareId), data.vaccess_hash()); }); return result; @@ -831,11 +831,11 @@ std::map ParsePeersLists( } User EmptyUser(UserId userId) { - return ParseUser(MTP_userEmpty(MTP_int(userId.bare))); // #TODO ids + return ParseUser(MTP_userEmpty(MTP_long(userId.bare))); } Chat EmptyChat(ChatId chatId) { - return ParseChat(MTP_chatEmpty(MTP_int(chatId.bare))); // #TODO ids + return ParseChat(MTP_chatEmpty(MTP_long(chatId.bare))); } Peer EmptyPeer(PeerId peerId) { diff --git a/Telegram/SourceFiles/export/export_api_wrap.cpp b/Telegram/SourceFiles/export/export_api_wrap.cpp index efddc6d9c2..c56ac4f89b 100644 --- a/Telegram/SourceFiles/export/export_api_wrap.cpp +++ b/Telegram/SourceFiles/export/export_api_wrap.cpp @@ -515,7 +515,7 @@ void ApiWrap::requestDialogsCount() { const auto offsetId = 0; const auto offsetPeer = MTP_inputPeerEmpty(); const auto limit = 1; - const auto hash = 0; + const auto hash = uint64(0); splitRequest(_startProcess->splitIndex, MTPmessages_GetDialogs( MTP_flags(0), MTPint(), // folder_id @@ -523,7 +523,7 @@ void ApiWrap::requestDialogsCount() { MTP_int(offsetId), offsetPeer, MTP_int(limit), - MTP_int(hash) + MTP_long(hash) )).done([=](const MTPmessages_Dialogs &result) { Expects(_settings != nullptr); Expects(_startProcess != nullptr); @@ -879,7 +879,7 @@ void ApiWrap::requestTopPeersSlice() { | Flag::f_phone_calls), MTP_int(_contactsProcess->topPeersOffset), MTP_int(kTopPeerSliceLimit), - MTP_int(0) // hash + MTP_long(0) // hash )).done([=](const MTPcontacts_TopPeers &result) { Expects(_contactsProcess != nullptr); @@ -1071,7 +1071,7 @@ void ApiWrap::requestSinglePeerDialog() { requestUser(MTP_inputUser(data.vuser_id(), data.vaccess_hash())); }, [&](const MTPDinputPeerChat &data) { mainRequest(MTPmessages_GetChats( - MTP_vector(1, data.vchat_id()) + MTP_vector(1, data.vchat_id()) )).done(std::move(doneSinglePeer)).send(); }, [&](const MTPDinputPeerChannel &data) { mainRequest(MTPchannels_GetChannels( @@ -1108,12 +1108,12 @@ mtpRequestId ApiWrap::requestSinglePeerMigrated( const auto migratedChatId = data.vfull_chat().match([&]( const MTPDchannelFull &data) { return data.vmigrated_from_chat_id().value_or_empty(); - }, [](auto &&other) { + }, [](auto &&other) -> BareId { return 0; }); return migratedChatId ? Data::ParseDialogsInfo( - MTP_inputPeerChat(MTP_int(migratedChatId)), + MTP_inputPeerChat(MTP_long(migratedChatId)), MTP_messages_chats(data.vchats())) : Data::DialogsInfo(); }); @@ -1169,7 +1169,7 @@ void ApiWrap::requestDialogsSlice() { } const auto splitIndex = _dialogsProcess->splitIndexPlusOne - 1; - const auto hash = 0; + const auto hash = uint64(0); splitRequest(splitIndex, MTPmessages_GetDialogs( MTP_flags(0), MTPint(), // folder_id @@ -1177,7 +1177,7 @@ void ApiWrap::requestDialogsSlice() { MTP_int(_dialogsProcess->offsetId), _dialogsProcess->offsetPeer, MTP_int(kChatsSliceLimit), - MTP_int(hash) + MTP_long(hash) )).done([=](const MTPmessages_Dialogs &result) { if (result.type() == mtpc_messages_dialogsNotModified) { error("Unexpected dialogsNotModified received."); @@ -1429,7 +1429,7 @@ void ApiWrap::requestChatMessages( MTP_int(limit), MTP_int(0), // max_id MTP_int(0), // min_id - MTP_int(0) // hash + MTP_long(0) // hash )).done(doneHandler).send(); } else { splitRequest(realSplitIndex, MTPmessages_GetHistory( @@ -1440,7 +1440,7 @@ void ApiWrap::requestChatMessages( MTP_int(limit), MTP_int(0), // max_id MTP_int(0), // min_id - MTP_int(0) // hash + MTP_long(0) // hash )).fail([=](const MTP::Error &error) { Expects(_chatProcess != nullptr); diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp index 18fe7c92f9..a3e71425d7 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp @@ -434,14 +434,15 @@ void InnerWidget::applySearch(const QString &query) { } void InnerWidget::requestAdmins() { - auto participantsHash = 0; + const auto offset = 0; + const auto participantsHash = uint64(0); _api.request(MTPchannels_GetParticipants( _channel->inputChannel, MTP_channelParticipantsAdmins(), - MTP_int(0), + MTP_int(offset), MTP_int(kMaxChannelAdmins), - MTP_int(participantsHash) - )).done([this](const MTPchannels_ChannelParticipants &result) { + MTP_long(participantsHash) + )).done([=](const MTPchannels_ChannelParticipants &result) { session().api().parseChannelParticipants(_channel, result, [&]( int availableCount, const QVector &list) { 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 d36c9fb48d..72ebea6aa6 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp @@ -97,7 +97,7 @@ MTPMessage PrepareLogMessage( data.vfrom_id() ? *data.vfrom_id() : MTPPeer(), data.vpeer_id(), data.vfwd_from() ? *data.vfwd_from() : MTPMessageFwdHeader(), - MTP_int(data.vvia_bot_id().value_or_empty()), + MTP_long(data.vvia_bot_id().value_or_empty()), MTPMessageReplyHeader(), MTP_int(newDate), data.vmessage(), @@ -1076,6 +1076,12 @@ void GenerateItems( addSimpleServiceMessage(text); }; + auto createChangeTheme = [&](const MTPDchannelAdminLogEventActionChangeTheme &data) { + const auto was = qs(data.vprev_value()); + const auto now = qs(data.vnew_value()); + // #TODO themes + }; + action.match([&](const MTPDchannelAdminLogEventActionChangeTitle &data) { createChangeTitle(data); }, [&](const MTPDchannelAdminLogEventActionChangeAbout &data) { @@ -1140,6 +1146,8 @@ void GenerateItems( createParticipantVolume(data); }, [&](const MTPDchannelAdminLogEventActionChangeHistoryTTL &data) { createChangeHistoryTTL(data); + }, [&](const MTPDchannelAdminLogEventActionChangeTheme &data) { + createChangeTheme(data); }); } diff --git a/Telegram/SourceFiles/history/history_message.cpp b/Telegram/SourceFiles/history/history_message.cpp index 39d8f7d557..aac094bc58 100644 --- a/Telegram/SourceFiles/history/history_message.cpp +++ b/Telegram/SourceFiles/history/history_message.cpp @@ -1104,7 +1104,7 @@ void HistoryMessage::createComponents(const CreateConfig &config) { MTP_int(0), MTP_int(0), MTPVector(), // recent_repliers - MTP_int(peerToChannel(linked->id).bare), + MTP_long(peerToChannel(linked->id).bare), MTP_int(0), // max_id MTP_int(0))); // read_max_id } diff --git a/Telegram/SourceFiles/history/history_service.cpp b/Telegram/SourceFiles/history/history_service.cpp index b7e911ed94..56e85e476f 100644 --- a/Telegram/SourceFiles/history/history_service.cpp +++ b/Telegram/SourceFiles/history/history_service.cpp @@ -618,7 +618,7 @@ bool HistoryService::updateDependent(bool force) { } HistoryService::PreparedText HistoryService::prepareInvitedToCallText( - const QVector &users, + const QVector &users, uint64 linkCallId) { const auto owner = &history()->owner(); auto chatText = tr::lng_action_invite_user_chat(tr::now); diff --git a/Telegram/SourceFiles/history/history_service.h b/Telegram/SourceFiles/history/history_service.h index 72c5dd3291..8922b0e225 100644 --- a/Telegram/SourceFiles/history/history_service.h +++ b/Telegram/SourceFiles/history/history_service.h @@ -161,7 +161,7 @@ private: PreparedText prepareGameScoreText(); PreparedText preparePaymentSentText(); PreparedText prepareInvitedToCallText( - const QVector &users, + const QVector &users, uint64 linkCallId); PreparedText prepareCallScheduledText( TimeId scheduleDate); diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 12210b96be..d72270cfb8 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -2795,10 +2795,10 @@ void HistoryWidget::firstLoadMessages() { } } - auto offsetDate = 0; - auto maxId = 0; - auto minId = 0; - auto historyHash = 0; + const auto offsetDate = 0; + const auto maxId = 0; + const auto minId = 0; + const auto historyHash = uint64(0); const auto history = from; const auto type = Data::Histories::RequestType::History; @@ -2812,7 +2812,7 @@ void HistoryWidget::firstLoadMessages() { MTP_int(loadCount), MTP_int(maxId), MTP_int(minId), - MTP_int(historyHash) + MTP_long(historyHash) )).done([=](const MTPmessages_Messages &result) { messagesReceived(history->peer, result, _firstLoadRequest); finish(); @@ -2836,20 +2836,20 @@ void HistoryWidget::loadMessages() { && (_history->isEmpty() || _history->loadedAtTop() || (!_migrated->isEmpty() && !_migrated->loadedAtBottom())); - auto from = loadMigrated ? _migrated : _history; + const auto from = loadMigrated ? _migrated : _history; if (from->loadedAtTop()) { return; } - auto offsetId = from->minMsgId(); - auto addOffset = 0; - auto loadCount = offsetId + const auto offsetId = from->minMsgId(); + const auto addOffset = 0; + const auto loadCount = offsetId ? kMessagesPerPage : kMessagesPerPageFirst; - auto offsetDate = 0; - auto maxId = 0; - auto minId = 0; - auto historyHash = 0; + const auto offsetDate = 0; + const auto maxId = 0; + const auto minId = 0; + const auto historyHash = uint64(0); const auto history = from; const auto type = Data::Histories::RequestType::History; @@ -2863,7 +2863,7 @@ void HistoryWidget::loadMessages() { MTP_int(loadCount), MTP_int(maxId), MTP_int(minId), - MTP_int(historyHash) + MTP_long(historyHash) )).done([=](const MTPmessages_Messages &result) { messagesReceived(history->peer, result, _preloadRequest); finish(); @@ -2889,7 +2889,7 @@ void HistoryWidget::loadMessagesDown() { return; } - auto loadCount = kMessagesPerPage; + const auto loadCount = kMessagesPerPage; auto addOffset = -loadCount; auto offsetId = from->maxMsgId(); if (!offsetId) { @@ -2897,10 +2897,10 @@ void HistoryWidget::loadMessagesDown() { ++offsetId; ++addOffset; } - auto offsetDate = 0; - auto maxId = 0; - auto minId = 0; - auto historyHash = 0; + const auto offsetDate = 0; + const auto maxId = 0; + const auto minId = 0; + const auto historyHash = uint64(0); const auto history = from; const auto type = Data::Histories::RequestType::History; @@ -2914,7 +2914,7 @@ void HistoryWidget::loadMessagesDown() { MTP_int(loadCount), MTP_int(maxId), MTP_int(minId), - MTP_int(historyHash) + MTP_long(historyHash) )).done([=](const MTPmessages_Messages &result) { messagesReceived(history->peer, result, _preloadDownRequest); finish(); @@ -2961,10 +2961,10 @@ void HistoryWidget::delayedShowAt(MsgId showAtMsgId) { offsetId = -_delayedShowAtMsgId; } } - auto offsetDate = 0; - auto maxId = 0; - auto minId = 0; - auto historyHash = 0; + const auto offsetDate = 0; + const auto maxId = 0; + const auto minId = 0; + const auto historyHash = uint64(0); const auto history = from; const auto type = Data::Histories::RequestType::History; @@ -2978,7 +2978,7 @@ void HistoryWidget::delayedShowAt(MsgId showAtMsgId) { MTP_int(loadCount), MTP_int(maxId), MTP_int(minId), - MTP_int(historyHash) + MTP_long(historyHash) )).done([=](const MTPmessages_Messages &result) { messagesReceived(history->peer, result, _delayedShowAtRequest); finish(); diff --git a/Telegram/SourceFiles/info/common_groups/info_common_groups_inner_widget.cpp b/Telegram/SourceFiles/info/common_groups/info_common_groups_inner_widget.cpp index df925b4d2e..37c0cd4c39 100644 --- a/Telegram/SourceFiles/info/common_groups/info_common_groups_inner_widget.cpp +++ b/Telegram/SourceFiles/info/common_groups/info_common_groups_inner_widget.cpp @@ -96,9 +96,9 @@ void ListController::loadMoreRows() { } _preloadRequestId = _api.request(MTPmessages_GetCommonChats( _user->inputUser, - MTP_int(peerIsChat(_preloadGroupId) + MTP_long(peerIsChat(_preloadGroupId) ? peerToChat(_preloadGroupId).bare - : peerToChannel(_preloadGroupId).bare), // #TODO ids + : peerToChannel(_preloadGroupId).bare), MTP_int(kCommonGroupsPerPage) )).done([this](const MTPmessages_Chats &result) { _preloadRequestId = 0; diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_send_data.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_send_data.cpp index ad36bb440e..2b6d12167e 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_send_data.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_bot_send_data.cpp @@ -102,7 +102,7 @@ SendDataCommon::SentMessageFields SendContact::getSentMessageFields() const { MTP_string(_firstName), MTP_string(_lastName), MTP_string(), // vcard - MTP_int(0)) }; // user_id + MTP_long(0)) }; // user_id } QString SendContact::getLayoutDescription(const Result *owner) const { diff --git a/Telegram/SourceFiles/intro/intro_qr.cpp b/Telegram/SourceFiles/intro/intro_qr.cpp index 3be3db8eb3..1ca0f50000 100644 --- a/Telegram/SourceFiles/intro/intro_qr.cpp +++ b/Telegram/SourceFiles/intro/intro_qr.cpp @@ -317,7 +317,7 @@ void QrWidget::refreshCode() { _requestId = api().request(MTPauth_ExportLoginToken( MTP_int(ApiId), MTP_string(ApiHash), - MTP_vector(0) + MTP_vector(0) )).done([=](const MTPauth_LoginToken &result) { handleTokenResult(result); }).fail([=](const MTP::Error &error) { diff --git a/Telegram/SourceFiles/main/main_account.cpp b/Telegram/SourceFiles/main/main_account.cpp index 9643c81f0b..5fee2c43a7 100644 --- a/Telegram/SourceFiles/main/main_account.cpp +++ b/Telegram/SourceFiles/main/main_account.cpp @@ -162,7 +162,7 @@ void Account::createSession( createSession( MTP_user( MTP_flags(flags), - MTP_int(base::take(_sessionUserId).bare), // #TODO ids + MTP_long(base::take(_sessionUserId).bare), MTPlong(), // access_hash MTPstring(), // first_name MTPstring(), // last_name diff --git a/Telegram/SourceFiles/passport/passport_form_controller.cpp b/Telegram/SourceFiles/passport/passport_form_controller.cpp index 11ee2a071a..09d0bd574a 100644 --- a/Telegram/SourceFiles/passport/passport_form_controller.cpp +++ b/Telegram/SourceFiles/passport/passport_form_controller.cpp @@ -752,7 +752,7 @@ std::vector> FormController::submitGetErrors() { bytes::make_span(_request.publicKey.toUtf8())); _submitRequestId = _api.request(MTPaccount_AcceptAuthorization( - MTP_int(_request.botId.bare), // #TODO ids + MTP_long(_request.botId.bare), MTP_string(_request.scope), MTP_string(_request.publicKey), MTP_vector(prepared.hashes), @@ -2302,7 +2302,7 @@ void FormController::requestForm() { return; } _formRequestId = _api.request(MTPaccount_GetAuthorizationForm( - MTP_int(_request.botId.bare), // #TODO ids + MTP_long(_request.botId.bare), MTP_string(_request.scope), MTP_string(_request.publicKey) )).done([=](const MTPaccount_AuthorizationForm &result) { diff --git a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp index 41612afe61..baf2030875 100644 --- a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp +++ b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp @@ -151,7 +151,7 @@ AdminLog::OwnedItem GenerateForwardedItem( MTPPeer(), // saved_from_peer MTPint(), // saved_from_msg_id MTPstring()), // psa_type - MTPint(), // via_bot_id + MTPlong(), // via_bot_id MTPMessageReplyHeader(), MTP_int(base::unixtime::now()), // date MTP_string(text), diff --git a/Telegram/SourceFiles/storage/serialize_peer.cpp b/Telegram/SourceFiles/storage/serialize_peer.cpp index c9b8c74133..9e80fe0437 100644 --- a/Telegram/SourceFiles/storage/serialize_peer.cpp +++ b/Telegram/SourceFiles/storage/serialize_peer.cpp @@ -178,7 +178,7 @@ void writePeer(QDataStream &stream, not_null peer) { << channel->name << quint64(channel->access) << qint32(channel->date) - << qint32(channel->version()) + << qint32(0) // legacy - version << qint32(0) << quint32(channel->flags()) << channel->inviteLink(); @@ -277,9 +277,8 @@ PeerData *readPeer( user->input = MTP_inputPeerSelf(); user->inputUser = MTP_inputUserSelf(); } else { - // #TODO ids - user->input = MTP_inputPeerUser(MTP_int(peerToUser(user->id).bare), MTP_long(user->accessHash())); - user->inputUser = MTP_inputUser(MTP_int(peerToUser(user->id).bare), MTP_long(user->accessHash())); + user->input = MTP_inputPeerUser(MTP_long(peerToUser(user->id).bare), MTP_long(user->accessHash())); + user->inputUser = MTP_inputUser(MTP_long(peerToUser(user->id).bare), MTP_long(user->accessHash())); } } } else if (const auto chat = result->asChat()) { @@ -350,8 +349,7 @@ PeerData *readPeer( chat->creator = creator; chat->setInviteLink(inviteLink); - // #TODO ids - chat->input = MTP_inputPeerChat(MTP_int(peerToChat(chat->id).bare)); + chat->input = MTP_inputPeerChat(MTP_long(peerToChat(chat->id).bare)); } } else if (const auto channel = result->asChannel()) { QString name, inviteLink; @@ -374,10 +372,6 @@ PeerData *readPeer( channel->access = access; channel->date = date; - // We don't save participants, admin status and banned rights. - // So we don't restore the version field, info is still unknown. - channel->setVersion(0); - if (streamAppVersion >= 2008007) { channel->setFlags(ChannelDataFlags::from_raw(flags)); } else { @@ -422,9 +416,8 @@ PeerData *readPeer( channel->setInviteLink(inviteLink); - // #TODO ids - channel->input = MTP_inputPeerChannel(MTP_int(peerToChannel(channel->id).bare), MTP_long(access)); - channel->inputChannel = MTP_inputChannel(MTP_int(peerToChannel(channel->id).bare), MTP_long(access)); + channel->input = MTP_inputPeerChannel(MTP_long(peerToChannel(channel->id).bare), MTP_long(access)); + channel->inputChannel = MTP_inputChannel(MTP_long(peerToChannel(channel->id).bare), MTP_long(access)); } } if (apply) { diff --git a/Telegram/SourceFiles/storage/storage_account.cpp b/Telegram/SourceFiles/storage/storage_account.cpp index 8d1e5010a3..b05eea82be 100644 --- a/Telegram/SourceFiles/storage/storage_account.cpp +++ b/Telegram/SourceFiles/storage/storage_account.cpp @@ -42,7 +42,7 @@ using Database = Cache::Database; constexpr auto kDelayedWriteTimeout = crl::time(1000); constexpr auto kStickersVersionTag = quint32(-1); -constexpr auto kStickersSerializeVersion = 1; +constexpr auto kStickersSerializeVersion = 2; constexpr auto kMaxSavedStickerSetsCount = 1000; constexpr auto kDefaultStickerInstallDate = TimeId(1); @@ -1550,11 +1550,11 @@ void Account::writeStickerSet( const auto writeInfo = [&](int count) { stream << quint64(set.id) - << quint64(set.access) + << quint64(set.accessHash) + << quint64(set.hash) << set.title << set.shortName << qint32(count) - << qint32(set.hash) << qint32(set.flags) << qint32(set.installDate); Serialize::writeImageLocation(stream, set.thumbnailLocation()); @@ -1625,11 +1625,11 @@ void Account::writeStickerSets( continue; } - // id + access + title + shortName + stickersCount + hash + flags + installDate - size += sizeof(quint64) * 2 + // id + accessHash + hash + title + shortName + stickersCount + flags + installDate + size += sizeof(quint64) * 3 + Serialize::stringSize(raw->title) + Serialize::stringSize(raw->shortName) - + sizeof(qint32) * 4 + + sizeof(qint32) * 3 + Serialize::imageLocationSize(raw->thumbnailLocation()); if (raw->flags & SetFlag::NotLoaded) { continue; @@ -1724,22 +1724,21 @@ void Account::readStickerSets( return failed(); } for (auto i = 0; i != count; ++i) { - quint64 setId = 0, setAccess = 0; + quint64 setId = 0, setAccessHash = 0, setHash = 0; QString setTitle, setShortName; qint32 scnt = 0; qint32 setInstallDate = 0; - qint32 setHash = 0; Data::StickersSetFlags setFlags = 0; qint32 setFlagsValue = 0; ImageLocation setThumbnail; stickers.stream >> setId - >> setAccess + >> setAccessHash + >> setHash >> setTitle >> setShortName >> scnt - >> setHash >> setFlagsValue >> setInstallDate; const auto thumbnail = Serialize::readImageLocation( @@ -1754,34 +1753,7 @@ void Account::readStickerSets( setThumbnail = *thumbnail; } - if (stickers.version >= 2008007) { - setFlags = Data::StickersSetFlags::from_raw(setFlagsValue); - } else { - using Saved = MTPDstickerSet::Flag; - using Flag = SetFlag; - struct Conversion { - Saved saved; - Flag flag; - }; - const auto conversions = { - Conversion{ Saved::f_archived, Flag::Archived }, - Conversion{ Saved::f_installed_date, Flag::Installed }, - Conversion{ Saved::f_masks, Flag::Masks }, - Conversion{ Saved::f_official, Flag::Official }, - Conversion{ Saved(1U << 30), Flag::NotLoaded }, - Conversion{ Saved(1U << 29), Flag::Featured }, - Conversion{ Saved(1U << 28), Flag::Unread }, - Conversion{ Saved(1U << 27), Flag::Special }, - }; - auto flagsSet = Flag() | 0; - for (const auto &conversion : conversions) { - if (setFlagsValue & int(conversion.saved)) { - flagsSet |= conversion.flag; - } - } - setFlags = flagsSet; - } - + setFlags = Data::StickersSetFlags::from_raw(setFlagsValue); if (setId == Data::Stickers::DefaultSetId) { setTitle = tr::lng_stickers_default_set(tr::now); setFlags |= SetFlag::Official | SetFlag::Special; @@ -1806,11 +1778,11 @@ void Account::readStickerSets( it = sets.emplace(setId, std::make_unique( &_owner->session().data(), setId, - setAccess, + setAccessHash, + setHash, setTitle, setShortName, 0, - setHash, setFlags, setInstallDate)).first; it->second->setThumbnail( @@ -1832,7 +1804,10 @@ void Account::readStickerSets( set->count = 0; } - Serialize::Document::StickerSetInfo info(setId, setAccess, setShortName); + Serialize::Document::StickerSetInfo info( + setId, + setAccessHash, + setShortName); base::flat_set read; for (int32 j = 0; j < scnt; ++j) { auto document = Serialize::Document::readStickerFromStream( @@ -2095,11 +2070,11 @@ void Account::importOldRecentStickers() { std::make_unique( &_owner->session().data(), Data::Stickers::DefaultSetId, - uint64(0), + uint64(0), // accessHash + uint64(0), // hash tr::lng_stickers_default_set(tr::now), QString(), 0, // count - 0, // hash (SetFlag::Official | SetFlag::Installed | SetFlag::Special), kDefaultStickerInstallDate)).first->second.get(); const auto custom = sets.emplace( @@ -2107,11 +2082,11 @@ void Account::importOldRecentStickers() { std::make_unique( &_owner->session().data(), Data::Stickers::CustomSetId, - uint64(0), + uint64(0), // accessHash + uint64(0), // hash qsl("Custom stickers"), QString(), 0, // count - 0, // hash (SetFlag::Installed | SetFlag::Special), kDefaultStickerInstallDate)).first->second.get(); @@ -2607,13 +2582,13 @@ Export::Settings Account::readExportSettings() { switch (singlePeerType) { case kSinglePeerTypeUser: return MTP_inputPeerUser( - MTP_int(singlePeerBareId), + MTP_long(singlePeerBareId), MTP_long(singlePeerAccessHash)); case kSinglePeerTypeChat: - return MTP_inputPeerChat(MTP_int(singlePeerBareId)); + return MTP_inputPeerChat(MTP_long(singlePeerBareId)); case kSinglePeerTypeChannel: return MTP_inputPeerChannel( - MTP_int(singlePeerBareId), + MTP_long(singlePeerBareId), MTP_long(singlePeerAccessHash)); case kSinglePeerTypeSelf: return MTP_inputPeerSelf(); diff --git a/Telegram/SourceFiles/support/support_autocomplete.cpp b/Telegram/SourceFiles/support/support_autocomplete.cpp index f9a4a180de..174afa8459 100644 --- a/Telegram/SourceFiles/support/support_autocomplete.cpp +++ b/Telegram/SourceFiles/support/support_autocomplete.cpp @@ -320,7 +320,7 @@ AdminLog::OwnedItem GenerateContactItem( MTP_string(data.firstName), MTP_string(data.lastName), MTP_string(), // vcard - MTP_int(0)), // user_id + MTP_long(0)), // user_id MTPReplyMarkup(), groupedId); return AdminLog::OwnedItem(delegate, item); diff --git a/Telegram/SourceFiles/ui/image/image_location.cpp b/Telegram/SourceFiles/ui/image/image_location.cpp index 9b934528c2..f95f8c5545 100644 --- a/Telegram/SourceFiles/ui/image/image_location.cpp +++ b/Telegram/SourceFiles/ui/image/image_location.cpp @@ -49,12 +49,12 @@ MTPInputPeer GenerateInputPeer( return MTP_inputPeerUserFromMessage( GenerateInputPeer(id, accessHash, 0, 0, self), MTP_int(inMessageId), - MTP_int(peerToUser(inMessagePeerId).bare)); // #TODO ids + MTP_long(peerToUser(inMessagePeerId).bare)); } else if (inMessageId && peerIsChannel(inMessagePeerId)) { return MTP_inputPeerChannelFromMessage( GenerateInputPeer(id, accessHash, 0, 0, self), MTP_int(inMessageId), - MTP_int(peerToChannel(inMessagePeerId).bare)); // #TODO ids + MTP_long(peerToChannel(inMessagePeerId).bare)); } else if (!id) { return MTP_inputPeerEmpty(); } else if (id == peerFromUser(self)) { diff --git a/Telegram/SourceFiles/window/window_session_controller.cpp b/Telegram/SourceFiles/window/window_session_controller.cpp index d2e6d3ff13..26ac84ca2d 100644 --- a/Telegram/SourceFiles/window/window_session_controller.cpp +++ b/Telegram/SourceFiles/window/window_session_controller.cpp @@ -208,7 +208,7 @@ void SessionNavigation::resolveChannelById( _resolveRequestId = _session->api().request(MTPchannels_GetChannels( MTP_vector( 1, - MTP_inputChannel(MTP_int(channelId.bare), MTP_long(0))) // #TODO ids + MTP_inputChannel(MTP_long(channelId.bare), MTP_long(0))) )).done([=](const MTPmessages_Chats &result) { result.match([&](const auto &data) { const auto peer = _session->data().processChats(data.vchats()); @@ -266,7 +266,7 @@ void SessionNavigation::showPeerByLinkResolved( return; } const auto id = call->id(); - const auto limit = 3; + const auto limit = 5; _resolveRequestId = _session->api().request( MTPphone_GetGroupCall(call->input(), MTP_int(limit)) ).done([=](const MTPphone_GroupCall &result) {