From 0d2b1c2072b7d90756c0fe142e9c33d27cfbf0cc Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 25 Jan 2022 12:36:30 +0300 Subject: [PATCH] Update layer to 138. --- td/generate/scheme/telegram_api.tl | 18 ++++++++++-------- td/telegram/MessageReaction.cpp | 16 ++++++++-------- td/telegram/StickersManager.cpp | 2 +- td/telegram/Version.h | 2 +- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/td/generate/scheme/telegram_api.tl b/td/generate/scheme/telegram_api.tl index 5292d122d..6e48a641e 100644 --- a/td/generate/scheme/telegram_api.tl +++ b/td/generate/scheme/telegram_api.tl @@ -180,7 +180,7 @@ messageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = messageActionSetChatTheme#aa786345 emoticon:string = MessageAction; messageActionChatJoinedByRequest#ebbca3cb = MessageAction; -dialog#2c171f72 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int = Dialog; +dialog#a8edd0f5 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int = Dialog; dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog; photoEmpty#2331b22d id:long = Photo; @@ -556,7 +556,7 @@ inputStickerSetAnimatedEmoji#28703c8 = InputStickerSet; inputStickerSetDice#e67f520e emoticon:string = InputStickerSet; inputStickerSetAnimatedEmojiAnimations#cde3739 = InputStickerSet; -stickerSet#d7df217a flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector thumb_dc_id:flags.4?int thumb_version:flags.4?int count:int hash:int = StickerSet; +stickerSet#d7df217a flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true gifs:flags.6?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector thumb_dc_id:flags.4?int thumb_version:flags.4?int count:int hash:int = StickerSet; messages.stickerSet#b60a24a6 set:StickerSet packs:Vector documents:Vector = messages.StickerSet; messages.stickerSetNotModified#d3f924eb = messages.StickerSet; @@ -1297,11 +1297,9 @@ auth.loggedOut#c3a2835f flags:# future_auth_token:flags.0?bytes = auth.LoggedOut reactionCount#6fb250d1 flags:# chosen:flags.0?true reaction:string count:int = ReactionCount; -messageReactions#87b6e36 flags:# min:flags.0?true can_see_list:flags.2?true results:Vector recent_reactons:flags.1?Vector = MessageReactions; +messageReactions#4f2b9479 flags:# min:flags.0?true can_see_list:flags.2?true results:Vector recent_reactions:flags.1?Vector = MessageReactions; -messageUserReaction#932844fa user_id:long reaction:string = MessageUserReaction; - -messages.messageReactionsList#a366923c flags:# count:int reactions:Vector users:Vector next_offset:flags.0?string = messages.MessageReactionsList; +messages.messageReactionsList#31bd492d flags:# count:int reactions:Vector chats:Vector users:Vector next_offset:flags.0?string = messages.MessageReactionsList; availableReaction#c077ec01 flags:# inactive:flags.0?true reaction:string title:string static_icon:Document appear_animation:Document select_animation:Document activate_animation:Document effect_animation:Document around_animation:flags.1?Document center_icon:flags.1?Document = AvailableReaction; @@ -1311,6 +1309,8 @@ messages.availableReactions#768e3aad hash:int reactions:Vector = Updates; messages.getMessageReactionsList#e0ee6b77 flags:# peer:InputPeer id:int reaction:flags.0?string offset:flags.1?string limit:int = messages.MessageReactionsList; messages.setChatAvailableReactions#14050ea6 peer:InputPeer available_reactions:Vector = Updates; messages.getAvailableReactions#18dea0ac hash:int = messages.AvailableReactions; messages.setDefaultReaction#d960c4d4 reaction:string = Bool; messages.translateText#24ce6dee flags:# peer:flags.0?InputPeer msg_id:flags.0?int text:flags.1?string from_lang:flags.2?string to_lang:string = messages.TranslatedText; +messages.getUnreadReactions#e85bae1a peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages; +messages.readReactions#82e251d7 peer:InputPeer = messages.AffectedHistory; updates.getState#edd4882a = updates.State; updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference; @@ -1692,7 +1694,7 @@ payments.getSavedInfo#227d824b = payments.SavedInfo; payments.clearSavedInfo#d83d70c1 flags:# credentials:flags.0?true info:flags.1?true = Bool; payments.getBankCardData#2e79d779 number:string = payments.BankCardData; -stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true animated:flags.1?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector software:flags.3?string = messages.StickerSet; +stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true animated:flags.1?true gifs:flags.4?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector software:flags.3?string = messages.StickerSet; stickers.removeStickerFromSet#f7760f51 sticker:InputDocument = messages.StickerSet; stickers.changeStickerPosition#ffb6d4ca sticker:InputDocument position:int = messages.StickerSet; stickers.addStickerToSet#8653febe stickerset:InputStickerSet sticker:InputStickerSetItem = messages.StickerSet; diff --git a/td/telegram/MessageReaction.cpp b/td/telegram/MessageReaction.cpp index 9d78f328d..198691c93 100644 --- a/td/telegram/MessageReaction.cpp +++ b/td/telegram/MessageReaction.cpp @@ -44,7 +44,7 @@ class SendReactionQuery final : public Td::ResultHandler { } send_query(G()->net_query_creator().create(telegram_api::messages_sendReaction( - flags, std::move(input_peer), message_id_.get_server_message_id().get(), reaction))); + flags, false /*ignored*/, std::move(input_peer), message_id_.get_server_message_id().get(), reaction))); } void on_result(BufferSlice packet) final { @@ -109,7 +109,7 @@ class GetMessageReactionsListQuery final : public Td::ResultHandler { LOG(INFO) << "Receive result for GetMessageReactionsListQuery: " << to_string(ptr); td_->contacts_manager_->on_get_users(std::move(ptr->users_), "GetMessageReactionsListQuery"); - // td_->contacts_manager_->on_get_chats(std::move(ptr->chats_), "GetMessageReactionsListQuery"); + td_->contacts_manager_->on_get_chats(std::move(ptr->chats_), "GetMessageReactionsListQuery"); int32 total_count = ptr->count_; if (total_count < static_cast(ptr->reactions_.size())) { @@ -119,13 +119,13 @@ class GetMessageReactionsListQuery final : public Td::ResultHandler { vector> reactions; for (auto &reaction : ptr->reactions_) { - UserId user_id(reaction->user_id_); - if (!user_id.is_valid() || (!reaction_.empty() && reaction_ != reaction->reaction_)) { + DialogId dialog_id(reaction->peer_id_); + if (!dialog_id.is_valid() || (!reaction_.empty() && reaction_ != reaction->reaction_)) { LOG(ERROR) << "Receive unexpected " << to_string(reaction); continue; } - auto message_sender = get_min_message_sender_object(td_, DialogId(user_id), "GetMessageReactionsListQuery"); + auto message_sender = get_min_message_sender_object(td_, dialog_id, "GetMessageReactionsListQuery"); if (message_sender != nullptr) { reactions.push_back( td_api::make_object(reaction->reaction_, std::move(message_sender))); @@ -207,9 +207,9 @@ unique_ptr MessageReactions::get_message_reactions( vector recent_chooser_dialog_ids; vector> recent_chooser_min_channels; - for (auto &user_reaction : reactions->recent_reactons_) { - if (user_reaction->reaction_ == reaction_count->reaction_) { - DialogId dialog_id(UserId(user_reaction->user_id_)); + for (auto &peer_reaction : reactions->recent_reactions_) { + if (peer_reaction->reaction_ == reaction_count->reaction_) { + DialogId dialog_id(peer_reaction->peer_id_); if (!dialog_id.is_valid()) { LOG(ERROR) << "Receive invalid " << dialog_id << " as a recent chooser"; continue; diff --git a/td/telegram/StickersManager.cpp b/td/telegram/StickersManager.cpp index f3f7e8ea6..d7dab28ff 100644 --- a/td/telegram/StickersManager.cpp +++ b/td/telegram/StickersManager.cpp @@ -1013,7 +1013,7 @@ class CreateNewStickerSetQuery final : public Td::ResultHandler { } send_query(G()->net_query_creator().create( - telegram_api::stickers_createStickerSet(flags, false /*ignored*/, false /*ignored*/, std::move(input_user), + telegram_api::stickers_createStickerSet(flags, false /*ignored*/, false /*ignored*/, false /*ignored*/, std::move(input_user), title, short_name, nullptr, std::move(input_stickers), software))); } diff --git a/td/telegram/Version.h b/td/telegram/Version.h index 2293226b8..9aab97581 100644 --- a/td/telegram/Version.h +++ b/td/telegram/Version.h @@ -10,7 +10,7 @@ namespace td { -constexpr int32 MTPROTO_LAYER = 137; +constexpr int32 MTPROTO_LAYER = 138; enum class Version : int32 { Initial, // 0