diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 617ba92bee..d749a39f67 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -2544,6 +2544,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_action_stake_game_lost_you" = "You lost {amount}"; "lng_action_change_creator" = "{from} made {user} the new main admin of the group."; "lng_action_new_creator_pending" = "{user} will become the new main admin in 7 days if {from} does not return."; +"lng_action_managed_bot_created" = "{from} created a bot {bot}."; "lng_stake_game_title" = "Emoji Stake"; "lng_stake_game_beta" = "Beta"; diff --git a/Telegram/SourceFiles/api/api_bot.cpp b/Telegram/SourceFiles/api/api_bot.cpp index af159e3486..fc02a07dbe 100644 --- a/Telegram/SourceFiles/api/api_bot.cpp +++ b/Telegram/SourceFiles/api/api_bot.cpp @@ -420,9 +420,12 @@ void ActivateBotCommand(ClickHandlerContext context, int row, int column) { const auto itemId = item->id; const auto id = int32(button->buttonId); const auto chosen = [=](std::vector> result) { + using Flag = MTPmessages_SendBotRequestedPeer::Flag; peer->session().api().request(MTPmessages_SendBotRequestedPeer( + MTP_flags(Flag::f_msg_id), peer->input(), MTP_int(itemId), + MTPstring(), // request_id MTP_int(id), MTP_vector_from_range( result | ranges::views::transform([]( diff --git a/Telegram/SourceFiles/api/api_editing.cpp b/Telegram/SourceFiles/api/api_editing.cpp index 17cea86d49..fbb17d49b5 100644 --- a/Telegram/SourceFiles/api/api_editing.cpp +++ b/Telegram/SourceFiles/api/api_editing.cpp @@ -207,7 +207,8 @@ mtpRequestId SuggestMessageOrMedia( inputMedia = MTP_inputMediaPhoto( MTP_flags(0), photo->mtpInput(), - MTPint()); // ttl_seconds + MTPint(), // ttl_seconds + MTPInputDocument()); // video } else if (const auto document = wasMedia->document()) { inputMedia = MTP_inputMediaDocument( MTP_flags(0), @@ -479,7 +480,8 @@ mtpRequestId EditTextMessage( return MTP_inputMediaPhoto( MTP_flags(flags), photo->mtpInput(), - MTP_int(media->ttlSeconds())); + MTP_int(media->ttlSeconds()), + MTPInputDocument()); // video }; takeFileReference = [=] { return photo->fileReference(); }; } else if (const auto document = media->document()) { diff --git a/Telegram/SourceFiles/api/api_media.cpp b/Telegram/SourceFiles/api/api_media.cpp index 845aa03894..582dc3e9b8 100644 --- a/Telegram/SourceFiles/api/api_media.cpp +++ b/Telegram/SourceFiles/api/api_media.cpp @@ -93,7 +93,8 @@ MTPInputMedia PrepareUploadedPhoto( info.file, MTP_vector( ranges::to>(info.attachedStickers)), - MTP_int(ttlSeconds)); + MTP_int(ttlSeconds), + MTPInputDocument()); // video } MTPInputMedia PrepareUploadedDocument( diff --git a/Telegram/SourceFiles/api/api_sending.cpp b/Telegram/SourceFiles/api/api_sending.cpp index 0799707617..38b1f85d75 100644 --- a/Telegram/SourceFiles/api/api_sending.cpp +++ b/Telegram/SourceFiles/api/api_sending.cpp @@ -332,7 +332,8 @@ void SendExistingPhoto( return MTP_inputMediaPhoto( MTP_flags(0), photo->mtpInput(), - MTPint()); + MTPint(), // ttl_seconds + MTPInputDocument()); // video }; SendExistingMedia( std::move(message), @@ -613,7 +614,8 @@ void SendConfirmedFile( MTP_flags(Flag::f_photo | (file->spoiler ? Flag::f_spoiler : Flag())), file->photo, - MTPint()); + MTPint(), // ttl_seconds + MTPDocument()); // video } else if (file->type == SendMediaType::File) { using Flag = MTPDmessageMediaDocument::Flag; return MTP_messageMediaDocument( diff --git a/Telegram/SourceFiles/api/api_transcribes.cpp b/Telegram/SourceFiles/api/api_transcribes.cpp index fae17a7566..bc31e1b998 100644 --- a/Telegram/SourceFiles/api/api_transcribes.cpp +++ b/Telegram/SourceFiles/api/api_transcribes.cpp @@ -257,7 +257,8 @@ void Transcribes::summarize(not_null item) { : MTP_flags(MTPmessages_summarizeText::Flag::f_to_lang), item->history()->peer->input(), MTP_int(item->id), - langCode.isEmpty() ? MTPstring() : MTP_string(langCode) + langCode.isEmpty() ? MTPstring() : MTP_string(langCode), + MTPstring() // tone )).done([=](const MTPTextWithEntities &result) { const auto &data = result.data(); auto &entry = _summaries[id]; diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index b7e86f20ca..eff428a778 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -4437,7 +4437,8 @@ void ApiWrap::uploadAlbumMedia( fields.vid(), fields.vaccess_hash(), fields.vfile_reference()), - MTP_int(data.vttl_seconds().value_or_empty())); + MTP_int(data.vttl_seconds().value_or_empty()), + MTPInputDocument()); // video sendAlbumWithUploaded(item, groupId, media); } break; diff --git a/Telegram/SourceFiles/data/data_poll.cpp b/Telegram/SourceFiles/data/data_poll.cpp index 658f7c209f..e2872028f5 100644 --- a/Telegram/SourceFiles/data/data_poll.cpp +++ b/Telegram/SourceFiles/data/data_poll.cpp @@ -89,6 +89,8 @@ bool PollData::applyChanges(const MTPDpoll &poll) { &session(), answer.vtext()); return result; + }, [](const auto &) { + return PollAnswer(); }); }) | ranges::views::take( kMaxOptions @@ -206,9 +208,12 @@ bool PollData::applyResultToAnswers( if (!answer) { return false; } - auto changed = (answer->votes != voters.vvoters().v); + const auto newVotes = voters.vvoters() + ? voters.vvoters()->v + : 0; + auto changed = (answer->votes != newVotes); if (changed) { - answer->votes = voters.vvoters().v; + answer->votes = newVotes; } if (!isMinResults) { if (answer->chosen != voters.is_chosen()) { @@ -258,10 +263,12 @@ bool PollData::quiz() const { MTPPoll PollDataToMTP(not_null poll, bool close) { const auto convert = [&](const PollAnswer &answer) { return MTP_pollAnswer( + MTP_flags(0), MTP_textWithEntities( MTP_string(answer.text.text), Api::EntitiesToMTP(&poll->session(), answer.text.entities)), - MTP_bytes(answer.option)); + MTP_bytes(answer.option), + MTPMessageMedia()); // media }; auto answers = QVector(); answers.reserve(poll->answers.size()); @@ -319,6 +326,8 @@ MTPInputMedia PollDataToInputMedia( MTP_flags(inputFlags), PollDataToMTP(poll, close), MTP_vector(correct), + MTPInputMedia(), // attached_media MTP_string(solution.text), - sentEntities); + sentEntities, + MTPInputMedia()); // solution_media } diff --git a/Telegram/SourceFiles/export/data/export_data_types.cpp b/Telegram/SourceFiles/export/data/export_data_types.cpp index cb6a0e391d..dc565a87f9 100644 --- a/Telegram/SourceFiles/export/data/export_data_types.cpp +++ b/Telegram/SourceFiles/export/data/export_data_types.cpp @@ -787,10 +787,12 @@ Poll ParsePoll(const MTPDmessageMediaPoll &data) { result.answers = ranges::views::all( poll.vanswers().v ) | ranges::views::transform([](const MTPPollAnswer &answer) { - const auto &data = answer.data(); auto result = Poll::Answer(); - result.text = ParseText(data.vtext()); - result.option = data.voption().v; + answer.match([&](const MTPDpollAnswer &data) { + result.text = ParseText(data.vtext()); + result.option = data.voption().v; + }, [](const auto &) { + }); return result; }) | ranges::to_vector; }); @@ -808,7 +810,9 @@ Poll ParsePoll(const MTPDmessageMediaPoll &data) { if (i == end(result.answers)) { continue; } - i->votes = voters.vvoters().v; + if (const auto votes = voters.vvoters()) { + i->votes = votes->v; + } if (voters.is_chosen()) { i->my = true; } @@ -1867,6 +1871,10 @@ ServiceAction ParseServiceAction( content.expired = data.is_expired(); content.newValue = (data.vnew_value().type() == mtpc_boolTrue); result.content = content; + }, [&](const MTPDmessageActionManagedBotCreated &data) { + auto content = ActionManagedBotCreated(); + content.botId = data.vbot_id().v; + result.content = content; }, [](const MTPDmessageActionEmpty &data) {}); return result; } diff --git a/Telegram/SourceFiles/export/data/export_data_types.h b/Telegram/SourceFiles/export/data/export_data_types.h index 20d08427cc..fbeac42816 100644 --- a/Telegram/SourceFiles/export/data/export_data_types.h +++ b/Telegram/SourceFiles/export/data/export_data_types.h @@ -755,6 +755,10 @@ struct ActionChangeCreator { UserId newCreatorId = 0; }; +struct ActionManagedBotCreated { + UserId botId = 0; +}; + struct ServiceAction { std::variant< v::null_t, @@ -812,7 +816,8 @@ struct ServiceAction { ActionNoForwardsToggle, ActionNoForwardsRequest, ActionNewCreatorPending, - ActionChangeCreator> content; + ActionChangeCreator, + ActionManagedBotCreated> content; }; ServiceAction ParseServiceAction( diff --git a/Telegram/SourceFiles/export/output/export_output_html.cpp b/Telegram/SourceFiles/export/output/export_output_html.cpp index eca65598eb..877d734604 100644 --- a/Telegram/SourceFiles/export/output/export_output_html.cpp +++ b/Telegram/SourceFiles/export/output/export_output_html.cpp @@ -1571,6 +1571,10 @@ auto HtmlWriter::Wrap::pushMessage( + " made " + peers.wrapUserName(data.newCreatorId) + " the new main admin of the group"; + }, [&](const ActionManagedBotCreated &data) { + return serviceFrom + + " created a bot " + + peers.wrapUserName(data.botId); }, [](v::null_t) { return QByteArray(); }); if (!serviceText.isEmpty()) { diff --git a/Telegram/SourceFiles/export/output/export_output_json.cpp b/Telegram/SourceFiles/export/output/export_output_json.cpp index cddb7fd6d6..3f53d6d186 100644 --- a/Telegram/SourceFiles/export/output/export_output_json.cpp +++ b/Telegram/SourceFiles/export/output/export_output_json.cpp @@ -760,6 +760,10 @@ QByteArray SerializeMessage( pushActor(); pushAction("change_creator"); pushBare("new_creator", wrapUserName(data.newCreatorId)); + }, [&](const ActionManagedBotCreated &data) { + pushActor(); + pushAction("managed_bot_created"); + pushBare("bot", wrapUserName(data.botId)); }, [](v::null_t) {}); if (v::is_null(message.action.content)) { diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index b73ff7068a..60f2dae262 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -6743,6 +6743,21 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) { return result; }; + auto prepareManagedBotCreated = [this](const MTPDmessageActionManagedBotCreated &action) { + auto result = PreparedServiceText(); + auto bot = _history->owner().user(action.vbot_id().v); + result.links.push_back(fromLink()); + result.links.push_back(bot->createOpenLink()); + result.text = tr::lng_action_managed_bot_created( + tr::now, + lt_from, + fromLinkText(), + lt_bot, + tr::link(bot->name(), 2), + tr::marked); + return result; + }; + setServiceText(action.match( prepareChatAddUserText, prepareChatJoinedByLink, @@ -6806,6 +6821,7 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) { prepareChangeCreator, prepareNoForwardsToggle, prepareNoForwardsRequest, + prepareManagedBotCreated, PrepareEmptyText, PrepareErrorText)); diff --git a/Telegram/SourceFiles/history/history_item_reply_markup.cpp b/Telegram/SourceFiles/history/history_item_reply_markup.cpp index 5646f5de4e..d2aa2f7b27 100644 --- a/Telegram/SourceFiles/history/history_item_reply_markup.cpp +++ b/Telegram/SourceFiles/history/history_item_reply_markup.cpp @@ -70,6 +70,7 @@ namespace { result.hasUsername = restriction(data.vhas_username()); result.myRights = rights(data.vuser_admin_rights()); result.botRights = rights(data.vbot_admin_rights()); + }, [](const MTPDrequestPeerTypeCreateBot &) { }); return result; } diff --git a/Telegram/SourceFiles/lang/translate_mtproto_provider.cpp b/Telegram/SourceFiles/lang/translate_mtproto_provider.cpp index 37b151042c..32fc122ca1 100644 --- a/Telegram/SourceFiles/lang/translate_mtproto_provider.cpp +++ b/Telegram/SourceFiles/lang/translate_mtproto_provider.cpp @@ -103,7 +103,8 @@ public: peer->input(), MTP_vector(ids), MTPVector(), - MTP_string(to.twoLetterCode()) + MTP_string(to.twoLetterCode()), + MTPstring() // tone )).done([=](const MTPmessages_TranslatedText &result) { doneFromList(result.data().vresult().v); }).fail([=](const MTP::Error &) { @@ -141,7 +142,8 @@ public: MTP_inputPeerEmpty(), MTPVector(), MTP_vector(text), - MTP_string(to.twoLetterCode()) + MTP_string(to.twoLetterCode()), + MTPstring() // tone )).done([=](const MTPmessages_TranslatedText &result) { doneFromList(result.data().vresult().v); }).fail([=](const MTP::Error &) { diff --git a/Telegram/SourceFiles/mtproto/scheme/api.tl b/Telegram/SourceFiles/mtproto/scheme/api.tl index bca9aecc02..8afa238268 100644 --- a/Telegram/SourceFiles/mtproto/scheme/api.tl +++ b/Telegram/SourceFiles/mtproto/scheme/api.tl @@ -29,8 +29,8 @@ inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile; inputFileStoryDocument#62dc8b48 id:InputDocument = InputFile; inputMediaEmpty#9664f57f = InputMedia; -inputMediaUploadedPhoto#1e287d04 flags:# spoiler:flags.2?true file:InputFile stickers:flags.0?Vector ttl_seconds:flags.1?int = InputMedia; -inputMediaPhoto#b3ba0635 flags:# spoiler:flags.1?true id:InputPhoto ttl_seconds:flags.0?int = InputMedia; +inputMediaUploadedPhoto#7d8375da flags:# spoiler:flags.2?true live_photo:flags.3?true file:InputFile stickers:flags.0?Vector ttl_seconds:flags.1?int video:flags.3?InputDocument = InputMedia; +inputMediaPhoto#e3af4434 flags:# spoiler:flags.1?true live_photo:flags.2?true id:InputPhoto ttl_seconds:flags.0?int video:flags.2?InputDocument = InputMedia; inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia; inputMediaContact#f8ab7dfb phone_number:string first_name:string last_name:string vcard:string = InputMedia; inputMediaUploadedDocument#37c9330 flags:# nosound_video:flags.3?true force_file:flags.4?true spoiler:flags.5?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector stickers:flags.0?Vector video_cover:flags.6?InputPhoto video_timestamp:flags.7?int ttl_seconds:flags.1?int = InputMedia; @@ -41,7 +41,7 @@ inputMediaDocumentExternal#779600f9 flags:# spoiler:flags.1?true url:string ttl_ inputMediaGame#d33f43f3 id:InputGame = InputMedia; inputMediaInvoice#405fef0d flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:flags.3?string provider_data:DataJSON start_param:flags.1?string extended_media:flags.2?InputMedia = InputMedia; inputMediaGeoLive#971fa843 flags:# stopped:flags.0?true geo_point:InputGeoPoint heading:flags.2?int period:flags.1?int proximity_notification_radius:flags.3?int = InputMedia; -inputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector solution:flags.1?string solution_entities:flags.1?Vector = InputMedia; +inputMediaPoll#b6bbf92a flags:# poll:Poll correct_answers:flags.0?Vector attached_media:flags.3?InputMedia solution:flags.1?string solution_entities:flags.1?Vector solution_media:flags.2?InputMedia = InputMedia; inputMediaDice#e66fbf7b emoticon:string = InputMedia; inputMediaStory#89fdd778 peer:InputPeer id:int = InputMedia; inputMediaWebPage#c21b8849 flags:# force_large_media:flags.0?true force_small_media:flags.1?true optional:flags.2?true url:string = InputMedia; @@ -122,7 +122,7 @@ message#3ae56482 flags:# out:flags.1?true mentioned:flags.4?true media_unread:fl messageService#7a800e0a flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true reactions_are_possible:flags.9?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer saved_peer_id:flags.28?Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction reactions:flags.20?MessageReactions ttl_period:flags.25?int = Message; messageMediaEmpty#3ded6320 = MessageMedia; -messageMediaPhoto#695150d7 flags:# spoiler:flags.3?true photo:flags.0?Photo ttl_seconds:flags.2?int = MessageMedia; +messageMediaPhoto#e216eb63 flags:# spoiler:flags.3?true live_photo:flags.4?true photo:flags.0?Photo ttl_seconds:flags.2?int video:flags.4?Document = MessageMedia; messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia; messageMediaContact#70322949 phone_number:string first_name:string last_name:string vcard:string user_id:long = MessageMedia; messageMediaUnsupported#9f84f49e = MessageMedia; @@ -132,7 +132,7 @@ messageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:str messageMediaGame#fdb19008 game:Game = MessageMedia; messageMediaInvoice#f6a548d3 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string extended_media:flags.4?MessageExtendedMedia = MessageMedia; messageMediaGeoLive#b940c666 flags:# geo:GeoPoint heading:flags.0?int period:int proximity_notification_radius:flags.1?int = MessageMedia; -messageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia; +messageMediaPoll#773f4e66 flags:# poll:Poll results:PollResults attached_media:flags.0?MessageMedia = MessageMedia; messageMediaDice#8cbec07 flags:# value:int emoticon:string game_outcome:flags.0?messages.EmojiGameOutcome = MessageMedia; messageMediaStory#68cb6283 flags:# via_mention:flags.1?true peer:Peer id:int story:flags.0?StoryItem = MessageMedia; messageMediaGiveaway#aa073beb flags:# only_new_subscribers:flags.0?true winners_are_visible:flags.2?true channels:Vector countries_iso2:flags.1?Vector prize_description:flags.3?string quantity:int months:flags.4?int stars:flags.5?long until_date:int = MessageMedia; @@ -205,6 +205,7 @@ messageActionNewCreatorPending#b07ed085 new_creator_id:long = MessageAction; messageActionChangeCreator#e188503b new_creator_id:long = MessageAction; messageActionNoForwardsToggle#bf7d6572 prev_value:Bool new_value:Bool = MessageAction; messageActionNoForwardsRequest#3e2793ba flags:# expired:flags.0?true prev_value:Bool new_value:Bool = MessageAction; +messageActionManagedBotCreated#16605e3e bot_id:long = MessageAction; dialog#d58a08c6 flags:# pinned:flags.2?true unread_mark:flags.3?true view_forum_as_messages:flags.6?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 ttl_period:flags.5?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; @@ -257,7 +258,7 @@ inputReportReasonFake#f5ddd6e7 = ReportReason; inputReportReasonIllegalDrugs#a8eb2be = ReportReason; inputReportReasonPersonalDetails#9ec7863d = ReportReason; -userFull#a02bc13e 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 voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true noforwards_my_enabled:flags2.23?true noforwards_peer_enabled:flags2.24?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?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:flags.15?ChatTheme private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings stars_rating:flags2.17?StarsRating stars_my_pending_rating:flags2.18?StarsRating stars_my_pending_rating_date:flags2.18?int main_tab:flags2.20?ProfileTab saved_music:flags2.21?Document note:flags2.22?TextWithEntities = UserFull; +userFull#a1ff514d 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 voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true noforwards_my_enabled:flags2.23?true noforwards_peer_enabled:flags2.24?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?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:flags.15?ChatTheme private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings stars_rating:flags2.17?StarsRating stars_my_pending_rating:flags2.18?StarsRating stars_my_pending_rating_date:flags2.18?int main_tab:flags2.20?ProfileTab saved_music:flags2.21?Document note:flags2.22?TextWithEntities bot_manager_id:flags2.23?long = UserFull; contact#145ade0b user_id:long mutual:Bool = Contact; @@ -460,6 +461,7 @@ updateStarGiftAuctionUserState#dc58f31e gift_id:long user_state:StarGiftAuctionU updateEmojiGameInfo#fb9c547a info:messages.EmojiGameInfo = Update; updateStarGiftCraftFail#ac072444 = Update; updateChatParticipantRank#bd8367b9 chat_id:long user_id:long rank:string version:int = Update; +updateManagedBot#4880ed9a user_id:long bot_id:long qts:int = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -1221,13 +1223,14 @@ help.supportName#8c05f1c9 name:string = help.SupportName; help.userInfoEmpty#f3ae2eed = help.UserInfo; help.userInfo#1eb3758 message:string entities:Vector author:string date:int = help.UserInfo; -pollAnswer#ff16e2ca text:TextWithEntities option:bytes = PollAnswer; +pollAnswer#d18be2ef flags:# text:TextWithEntities option:bytes media:flags.0?MessageMedia = PollAnswer; +inputPollAnswer#f1de1a00 flags:# text:TextWithEntities option:bytes media:flags.0?InputMedia = PollAnswer; -poll#58747131 id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true question:TextWithEntities answers:Vector close_period:flags.4?int close_date:flags.5?int = Poll; +poll#58747131 id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true open_answers:flags.6?true revoting_disabled:flags.7?true shuffle_answers:flags.8?true hide_results_until_close:flags.9?true question:TextWithEntities answers:Vector close_period:flags.4?int close_date:flags.5?int = Poll; -pollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters; +pollAnswerVoters#3645230a flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:flags.2?int recent_voters:flags.2?Vector = PollAnswerVoters; -pollResults#7adf2420 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#ba7bb15e 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 solution_media:flags.5?MessageMedia = PollResults; chatOnlines#f041e250 onlines:int = ChatOnlines; @@ -1609,6 +1612,7 @@ exportedContactToken#41bf109b url:string expires:int = ExportedContactToken; requestPeerTypeUser#5f3b8a00 flags:# bot:flags.0?Bool premium:flags.1?Bool = RequestPeerType; requestPeerTypeChat#c9f06e1b flags:# creator:flags.0?true bot_participant:flags.5?true has_username:flags.3?Bool forum:flags.4?Bool user_admin_rights:flags.1?ChatAdminRights bot_admin_rights:flags.2?ChatAdminRights = RequestPeerType; requestPeerTypeBroadcast#339bef6c flags:# creator:flags.0?true has_username:flags.3?Bool user_admin_rights:flags.1?ChatAdminRights bot_admin_rights:flags.2?ChatAdminRights = RequestPeerType; +requestPeerTypeCreateBot#3e81e078 flags:# bot_managed:flags.0?true suggested_name:flags.1?string suggested_username:flags.2?string = RequestPeerType; emojiListNotModified#481eadfa = EmojiList; emojiList#7a1e11d1 hash:long document_id:Vector = EmojiList; @@ -2129,6 +2133,12 @@ starGiftAttributeRarityLegendary#cef7e7a8 = StarGiftAttributeRarity; keyboardButtonStyle#4fdd3430 flags:# bg_primary:flags.0?true bg_danger:flags.1?true bg_success:flags.2?true icon:flags.3?long = KeyboardButtonStyle; +inputMessageReadMetric#402b4495 msg_id:int view_id:long time_in_view_ms:int active_time_in_view_ms:int height_to_viewport_ratio_permille:int seen_range_ratio_permille:int = InputMessageReadMetric; + +bots.exportedBotToken#3c60b621 token:string = bots.ExportedBotToken; + +bots.requestedButton#21f96ca7 request_id:string = bots.RequestedButton; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -2485,7 +2495,7 @@ messages.getMessageReactionsList#461b3f48 flags:# peer:InputPeer id:int reaction messages.setChatAvailableReactions#864b2581 flags:# peer:InputPeer available_reactions:ChatReactions reactions_limit:flags.0?int paid_enabled:flags.1?Bool = Updates; messages.getAvailableReactions#18dea0ac hash:int = messages.AvailableReactions; messages.setDefaultReaction#4f47a016 reaction:Reaction = Bool; -messages.translateText#63183030 flags:# peer:flags.0?InputPeer id:flags.0?Vector text:flags.1?Vector to_lang:string = messages.TranslatedText; +messages.translateText#a5eec345 flags:# peer:flags.0?InputPeer id:flags.0?Vector text:flags.1?Vector to_lang:string tone:flags.2?string = messages.TranslatedText; messages.getUnreadReactions#bd7f90ac flags:# peer:InputPeer top_msg_id:flags.0?int saved_peer_id:flags.1?InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages; messages.readReactions#9ec44f93 flags:# peer:InputPeer top_msg_id:flags.0?int saved_peer_id:flags.1?InputPeer = messages.AffectedHistory; messages.searchSentMedia#107e31a0 q:string filter:MessagesFilter limit:int = messages.Messages; @@ -2509,7 +2519,7 @@ messages.clearRecentReactions#9dfeefb4 = Bool; messages.getExtendedMedia#84f80814 peer:InputPeer id:Vector = Updates; messages.setDefaultHistoryTTL#9eb51445 period:int = Bool; messages.getDefaultHistoryTTL#658b7188 = DefaultHistoryTTL; -messages.sendBotRequestedPeer#91b2d060 peer:InputPeer msg_id:int button_id:int requested_peers:Vector = Updates; +messages.sendBotRequestedPeer#9ce417c8 flags:# peer:InputPeer msg_id:flags.0?int request_id:flags.1?string button_id:int requested_peers:Vector = Updates; messages.getEmojiGroups#7488ce5b hash:int = messages.EmojiGroups; messages.getEmojiStatusGroups#2ecd56cd hash:int = messages.EmojiGroups; messages.getEmojiProfilePhotoGroups#21a548f3 hash:int = messages.EmojiGroups; @@ -2569,12 +2579,15 @@ messages.reorderPinnedForumTopics#e7841f0 flags:# force:flags.0?true peer:InputP messages.createForumTopic#2f98c3d5 flags:# title_missing:flags.4?true peer:InputPeer title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates; messages.deleteTopicHistory#d2816f10 peer:InputPeer top_msg_id:int = messages.AffectedHistory; messages.getEmojiGameInfo#fb7e8ca7 = messages.EmojiGameInfo; -messages.summarizeText#9d4104e2 flags:# peer:InputPeer id:int to_lang:flags.0?string = TextWithEntities; +messages.summarizeText#abbbd346 flags:# peer:InputPeer id:int to_lang:flags.0?string tone:flags.2?string = TextWithEntities; messages.editChatCreator#f743b857 peer:InputPeer user_id:InputUser password:InputCheckPasswordSRP = Updates; messages.getFutureChatCreatorAfterLeave#3b7d0ea6 peer:InputPeer = User; messages.editChatParticipantRank#a00f32b0 peer:InputPeer participant:InputPeer rank:string = Updates; messages.declineUrlAuth#35436bbc url:string = Bool; messages.checkUrlAuthMatchCode#c9a47b0b url:string match_code:string = Bool; +messages.reportReadMetrics#4067c5e6 peer:InputPeer metrics:Vector = Bool; +messages.reportMusicListen#ddbcd819 id:InputDocument listened_duration:int = Bool; +messages.addPollAnswer#19bc4b6d peer:InputPeer msg_id:int answer:PollAnswer = Updates; updates.getState#edd4882a = updates.State; updates.getDifference#19c2f763 flags:# pts:int pts_limit:flags.1?int pts_total_limit:flags.0?int date:int qts:int qts_limit:flags.2?int = updates.Difference; @@ -2710,6 +2723,11 @@ bots.getAdminedBots#b0711d83 = Vector; bots.updateStarRefProgram#778b5ab3 flags:# bot:InputUser commission_permille:int duration_months:flags.0?int = StarRefProgram; bots.setCustomVerification#8b89dfbd flags:# enabled:flags.1?true bot:flags.0?InputUser peer:InputPeer custom_description:flags.2?string = Bool; bots.getBotRecommendations#a1b70815 bot:InputUser = users.Users; +bots.checkUsername#87f2219b username:string = Bool; +bots.createBot#e5b17f2b flags:# via_deeplink:flags.0?true name:string username:string manager_id:InputUser = User; +bots.exportBotToken#63b089 bot_id:long revoke:Bool = bots.ExportedBotToken; +bots.requestWebViewButton#31a2a35e user_id:InputUser button:KeyboardButton = bots.RequestedButton; +bots.getRequestedWebViewButton#b2c948b9 bot:InputUser request_id:string = KeyboardButton; payments.getPaymentForm#37148dbb flags:# invoice:InputInvoice theme_params:flags.0?DataJSON = payments.PaymentForm; payments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.PaymentReceipt; @@ -2759,7 +2777,7 @@ payments.getStarGiftWithdrawalUrl#d06e93a8 stargift:InputSavedStarGift password: payments.toggleChatStarGiftNotifications#60eaefa1 flags:# enabled:flags.0?true peer:InputPeer = Bool; payments.toggleStarGiftsPinnedToTop#1513e7b0 peer:InputPeer stargift:Vector = Bool; payments.canPurchaseStore#4fdc5ea7 purpose:InputStorePaymentPurpose = Bool; -payments.getResaleStarGifts#7a5fa236 flags:# sort_by_price:flags.1?true sort_by_num:flags.2?true for_craft:flags.4?true attributes_hash:flags.0?long gift_id:long attributes:flags.3?Vector offset:string limit:int = payments.ResaleStarGifts; +payments.getResaleStarGifts#7a5fa236 flags:# sort_by_price:flags.1?true sort_by_num:flags.2?true for_craft:flags.4?true stars_only:flags.5?true attributes_hash:flags.0?long gift_id:long attributes:flags.3?Vector offset:string limit:int = payments.ResaleStarGifts; payments.updateStarGiftPrice#edbe6ccb stargift:InputSavedStarGift resell_amount:StarsAmount = Updates; payments.createStarGiftCollection#1f4a0e87 peer:InputPeer title:string stargift:Vector = StarGiftCollection; payments.updateStarGiftCollection#4fddbee7 flags:# peer:InputPeer collection_id:int title:flags.0?string delete_stargift:flags.1?Vector add_stargift:flags.2?Vector order:flags.3?Vector = StarGiftCollection; @@ -2911,4 +2929,4 @@ smsjobs.finishJob#4f1ebf24 flags:# job_id:string error:flags.0?string = Bool; fragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo; -// LAYER 223 +// LAYER 224 diff --git a/Telegram/SourceFiles/storage/file_upload.cpp b/Telegram/SourceFiles/storage/file_upload.cpp index 767cd68291..64fb8ee64b 100644 --- a/Telegram/SourceFiles/storage/file_upload.cpp +++ b/Telegram/SourceFiles/storage/file_upload.cpp @@ -976,7 +976,8 @@ void Uploader::uploadCoverAsPhoto( MTP_flags(0), cover.info.file, MTP_vector(0), - MTP_int(0)) + MTP_int(0), + MTPInputDocument()) // video )).done([=](const MTPMessageMedia &result) { result.match([&](const MTPDmessageMediaPhoto &data) { const auto photo = data.vphoto();