From b965aecc6c5fc36a1306ca153ecbb2d082252626 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 13 Jun 2025 13:40:46 +0400 Subject: [PATCH] Update API scheme to layer 206. --- Telegram/SourceFiles/api/api_common.cpp | 10 ++++++++++ Telegram/SourceFiles/api/api_common.h | 13 +++++++++++++ Telegram/SourceFiles/api/api_polls.cpp | 6 +++++- Telegram/SourceFiles/api/api_sending.cpp | 18 +++++++++++++++--- Telegram/SourceFiles/api/api_todo_lists.cpp | 6 +++++- Telegram/SourceFiles/api/api_updates.cpp | 6 ++++-- Telegram/SourceFiles/apiwrap.cpp | 18 ++++++++++++++---- .../data/business/data_shortcut_messages.cpp | 5 ++++- .../data/components/scheduled_messages.cpp | 8 ++++++-- Telegram/SourceFiles/data/data_session.cpp | 3 ++- .../export/data/export_data_types.cpp | 8 ++++++++ .../export/data/export_data_types.h | 11 ++++++++++- .../export/output/export_output_html.cpp | 18 ++++++++++++++++++ .../export/output/export_output_json.cpp | 12 ++++++++++++ .../admin_log/history_admin_log_item.cpp | 6 ++++-- Telegram/SourceFiles/history/history_item.cpp | 5 +++++ .../media/stories/media_stories_share.cpp | 6 +++++- Telegram/SourceFiles/mtproto/scheme/api.tl | 12 ++++++++---- .../settings/settings_privacy_controllers.cpp | 3 ++- .../SourceFiles/window/window_peer_menu.cpp | 3 ++- 20 files changed, 152 insertions(+), 25 deletions(-) diff --git a/Telegram/SourceFiles/api/api_common.cpp b/Telegram/SourceFiles/api/api_common.cpp index cfb1e72207..bd0e9302a4 100644 --- a/Telegram/SourceFiles/api/api_common.cpp +++ b/Telegram/SourceFiles/api/api_common.cpp @@ -14,6 +14,16 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace Api { +MTPSuggestedPost SuggestToMTP(const std::optional &suggest) { + using Flag = MTPDsuggestedPost::Flag; + return suggest + ? MTP_suggestedPost( + MTP_flags(suggest->date ? Flag::f_schedule_date : Flag()), + MTP_long(suggest->stars), + MTP_int(suggest->date)) + : MTPSuggestedPost(); +} + SendAction::SendAction( not_null thread, SendOptions options) diff --git a/Telegram/SourceFiles/api/api_common.h b/Telegram/SourceFiles/api/api_common.h index c58f525c95..e648102d06 100644 --- a/Telegram/SourceFiles/api/api_common.h +++ b/Telegram/SourceFiles/api/api_common.h @@ -19,6 +19,18 @@ namespace Api { inline constexpr auto kScheduledUntilOnlineTimestamp = TimeId(0x7FFFFFFE); +struct SuggestOptions { + int stars = 0; + TimeId date = 0; + + friend inline bool operator==( + const SuggestOptions &, + const SuggestOptions &) = default; +}; + +[[nodiscard]] MTPSuggestedPost SuggestToMTP( + const std::optional &suggest); + struct SendOptions { uint64 price = 0; PeerData *sendAs = nullptr; @@ -31,6 +43,7 @@ struct SendOptions { bool invertCaption = false; bool hideViaBot = false; crl::time ttlSeconds = 0; + std::optional suggest; friend inline bool operator==( const SendOptions &, diff --git a/Telegram/SourceFiles/api/api_polls.cpp b/Telegram/SourceFiles/api/api_polls.cpp index d6ffaf551d..810d515875 100644 --- a/Telegram/SourceFiles/api/api_polls.cpp +++ b/Telegram/SourceFiles/api/api_polls.cpp @@ -75,6 +75,9 @@ void Polls::create( if (action.options.effectId) { sendFlags |= MTPmessages_SendMedia::Flag::f_effect; } + if (action.options.suggest) { + sendFlags |= MTPmessages_SendMedia::Flag::f_suggested_post; + } if (starsPaid) { action.options.starsApproved -= starsPaid; sendFlags |= MTPmessages_SendMedia::Flag::f_allow_paid_stars; @@ -102,7 +105,8 @@ void Polls::create( (sendAs ? sendAs->input : MTP_inputPeerEmpty()), Data::ShortcutIdToMTP(_session, action.options.shortcutId), MTP_long(action.options.effectId), - MTP_long(starsPaid) + MTP_long(starsPaid), + SuggestToMTP(action.options.suggest) ), [=](const MTPUpdates &result, const MTP::Response &response) { if (clearCloudDraft) { history->finishSavingCloudDraft( diff --git a/Telegram/SourceFiles/api/api_sending.cpp b/Telegram/SourceFiles/api/api_sending.cpp index 814b0a9832..4d000104eb 100644 --- a/Telegram/SourceFiles/api/api_sending.cpp +++ b/Telegram/SourceFiles/api/api_sending.cpp @@ -109,6 +109,9 @@ void SendSimpleMedia(SendAction action, MTPInputMedia inputMedia) { if (action.options.effectId) { sendFlags |= MTPmessages_SendMedia::Flag::f_effect; } + if (action.options.suggest) { + sendFlags |= MTPmessages_SendMedia::Flag::f_suggested_post; + } if (action.options.invertCaption) { flags |= MessageFlag::InvertMedia; sendFlags |= MTPmessages_SendMedia::Flag::f_invert_media; @@ -136,7 +139,8 @@ void SendSimpleMedia(SendAction action, MTPInputMedia inputMedia) { (sendAs ? sendAs->input : MTP_inputPeerEmpty()), Data::ShortcutIdToMTP(session, action.options.shortcutId), MTP_long(action.options.effectId), - MTP_long(starsPaid) + MTP_long(starsPaid), + SuggestToMTP(action.options.suggest) ), [=](const MTPUpdates &result, const MTP::Response &response) { }, [=](const MTP::Error &error, const MTP::Response &response) { api->sendMessageFail(error, peer, randomId); @@ -211,6 +215,9 @@ void SendExistingMedia( if (action.options.effectId) { sendFlags |= MTPmessages_SendMedia::Flag::f_effect; } + if (action.options.suggest) { + sendFlags |= MTPmessages_SendMedia::Flag::f_suggested_post; + } if (action.options.invertCaption) { flags |= MessageFlag::InvertMedia; sendFlags |= MTPmessages_SendMedia::Flag::f_invert_media; @@ -255,7 +262,8 @@ void SendExistingMedia( (sendAs ? sendAs->input : MTP_inputPeerEmpty()), Data::ShortcutIdToMTP(session, action.options.shortcutId), MTP_long(action.options.effectId), - MTP_long(starsPaid) + MTP_long(starsPaid), + SuggestToMTP(action.options.suggest) ), [=](const MTPUpdates &result, const MTP::Response &response) { }, [=](const MTP::Error &error, const MTP::Response &response) { if (error.code() == 400 @@ -391,6 +399,9 @@ bool SendDice(MessageToSend &message) { if (action.options.effectId) { sendFlags |= MTPmessages_SendMedia::Flag::f_effect; } + if (action.options.suggest) { + sendFlags |= MTPmessages_SendMedia::Flag::f_suggested_post; + } if (action.options.invertCaption) { flags |= MessageFlag::InvertMedia; sendFlags |= MTPmessages_SendMedia::Flag::f_invert_media; @@ -435,7 +446,8 @@ bool SendDice(MessageToSend &message) { (sendAs ? sendAs->input : MTP_inputPeerEmpty()), Data::ShortcutIdToMTP(session, action.options.shortcutId), MTP_long(action.options.effectId), - MTP_long(starsPaid) + MTP_long(starsPaid), + SuggestToMTP(action.options.suggest) ), [=](const MTPUpdates &result, const MTP::Response &response) { }, [=](const MTP::Error &error, const MTP::Response &response) { api->sendMessageFail(error, peer, randomId, newId); diff --git a/Telegram/SourceFiles/api/api_todo_lists.cpp b/Telegram/SourceFiles/api/api_todo_lists.cpp index ee0d64639a..af45543d52 100644 --- a/Telegram/SourceFiles/api/api_todo_lists.cpp +++ b/Telegram/SourceFiles/api/api_todo_lists.cpp @@ -77,6 +77,9 @@ void TodoLists::create( if (action.options.effectId) { sendFlags |= MTPmessages_SendMedia::Flag::f_effect; } + if (action.options.suggest) { + sendFlags |= MTPmessages_SendMedia::Flag::f_suggested_post; + } if (starsPaid) { action.options.starsApproved -= starsPaid; sendFlags |= MTPmessages_SendMedia::Flag::f_allow_paid_stars; @@ -104,7 +107,8 @@ void TodoLists::create( (sendAs ? sendAs->input : MTP_inputPeerEmpty()), Data::ShortcutIdToMTP(_session, action.options.shortcutId), MTP_long(action.options.effectId), - MTP_long(starsPaid) + MTP_long(starsPaid), + SuggestToMTP(action.options.suggest) ), [=](const MTPUpdates &result, const MTP::Response &response) { if (clearCloudDraft) { history->finishSavingCloudDraft( diff --git a/Telegram/SourceFiles/api/api_updates.cpp b/Telegram/SourceFiles/api/api_updates.cpp index aa3934e4d2..d2a19a7420 100644 --- a/Telegram/SourceFiles/api/api_updates.cpp +++ b/Telegram/SourceFiles/api/api_updates.cpp @@ -1228,7 +1228,8 @@ void Updates::applyUpdatesNoPtsCheck(const MTPUpdates &updates) { MTPlong(), // effect MTPFactCheck(), MTPint(), // report_delivery_until_date - MTPlong()), // paid_message_stars + MTPlong(), // paid_message_stars + MTPSuggestedPost()), MessageFlags(), NewMessageType::Unread); } break; @@ -1267,7 +1268,8 @@ void Updates::applyUpdatesNoPtsCheck(const MTPUpdates &updates) { MTPlong(), // effect MTPFactCheck(), MTPint(), // report_delivery_until_date - MTPlong()), // paid_message_stars + MTPlong(), // paid_message_stars + MTPSuggestedPost()), MessageFlags(), NewMessageType::Unread); } break; diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index cbbbf0e65a..0e25f99903 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -3963,6 +3963,10 @@ void ApiWrap::sendMessage(MessageToSend &&message) { sendFlags |= MTPmessages_SendMessage::Flag::f_effect; mediaFlags |= MTPmessages_SendMedia::Flag::f_effect; } + if (action.options.suggest) { + sendFlags |= MTPmessages_SendMessage::Flag::f_suggested_post; + mediaFlags |= MTPmessages_SendMedia::Flag::f_suggested_post; + } const auto starsPaid = std::min( peer->starsPerMessageChecked(), action.options.starsApproved); @@ -4030,7 +4034,8 @@ void ApiWrap::sendMessage(MessageToSend &&message) { (sendAs ? sendAs->input : MTP_inputPeerEmpty()), mtpShortcut, MTP_long(action.options.effectId), - MTP_long(starsPaid) + MTP_long(starsPaid), + SuggestToMTP(action.options.suggest) ), done, fail); } else { histories.sendPreparedMessage( @@ -4049,7 +4054,8 @@ void ApiWrap::sendMessage(MessageToSend &&message) { (sendAs ? sendAs->input : MTP_inputPeerEmpty()), mtpShortcut, MTP_long(action.options.effectId), - MTP_long(starsPaid) + MTP_long(starsPaid), + SuggestToMTP(action.options.suggest) ), done, fail); } isFirst = false; @@ -4355,6 +4361,7 @@ void ApiWrap::sendMediaWithRandomId( | (options.sendAs ? Flag::f_send_as : Flag(0)) | (options.shortcutId ? Flag::f_quick_reply_shortcut : Flag(0)) | (options.effectId ? Flag::f_effect : Flag(0)) + | (options.suggest ? Flag::f_suggested_post : Flag(0)) | (options.invertCaption ? Flag::f_invert_media : Flag(0)) | (starsPaid ? Flag::f_allow_paid_stars : Flag(0)); @@ -4383,7 +4390,8 @@ void ApiWrap::sendMediaWithRandomId( (options.sendAs ? options.sendAs->input : MTP_inputPeerEmpty()), Data::ShortcutIdToMTP(_session, options.shortcutId), MTP_long(options.effectId), - MTP_long(starsPaid) + MTP_long(starsPaid), + SuggestToMTP(options.suggest) ), [=](const MTPUpdates &result, const MTP::Response &response) { if (done) done(true); if (updateRecentStickers) { @@ -4438,6 +4446,7 @@ void ApiWrap::sendMultiPaidMedia( | (options.sendAs ? Flag::f_send_as : Flag(0)) | (options.shortcutId ? Flag::f_quick_reply_shortcut : Flag(0)) | (options.effectId ? Flag::f_effect : Flag(0)) + | (options.suggest ? Flag::f_suggested_post : Flag(0)) | (options.invertCaption ? Flag::f_invert_media : Flag(0)) | (starsPaid ? Flag::f_allow_paid_stars : Flag(0)); @@ -4465,7 +4474,8 @@ void ApiWrap::sendMultiPaidMedia( (options.sendAs ? options.sendAs->input : MTP_inputPeerEmpty()), Data::ShortcutIdToMTP(_session, options.shortcutId), MTP_long(options.effectId), - MTP_long(starsPaid) + MTP_long(starsPaid), + SuggestToMTP(options.suggest) ), [=](const MTPUpdates &result, const MTP::Response &response) { if (const auto album = _sendingAlbums.take(groupId)) { const auto copy = (*album)->items; diff --git a/Telegram/SourceFiles/data/business/data_shortcut_messages.cpp b/Telegram/SourceFiles/data/business/data_shortcut_messages.cpp index a195921a4c..e3701b18b9 100644 --- a/Telegram/SourceFiles/data/business/data_shortcut_messages.cpp +++ b/Telegram/SourceFiles/data/business/data_shortcut_messages.cpp @@ -93,7 +93,10 @@ constexpr auto kRequestTimeLimit = 60 * crl::time(1000); MTP_long(data.veffect().value_or_empty()), (data.vfactcheck() ? *data.vfactcheck() : MTPFactCheck()), MTP_int(data.vreport_delivery_until_date().value_or_empty()), - MTP_long(data.vpaid_message_stars().value_or_empty())); + MTP_long(data.vpaid_message_stars().value_or_empty()), + (data.vsuggested_post() + ? *data.vsuggested_post() + : MTPSuggestedPost())); }); } diff --git a/Telegram/SourceFiles/data/components/scheduled_messages.cpp b/Telegram/SourceFiles/data/components/scheduled_messages.cpp index 9e88a17f78..493a3cc36f 100644 --- a/Telegram/SourceFiles/data/components/scheduled_messages.cpp +++ b/Telegram/SourceFiles/data/components/scheduled_messages.cpp @@ -97,7 +97,10 @@ constexpr auto kRequestTimeLimit = 60 * crl::time(1000); MTP_long(data.veffect().value_or_empty()), // effect data.vfactcheck() ? *data.vfactcheck() : MTPFactCheck(), MTP_int(data.vreport_delivery_until_date().value_or_empty()), - MTP_long(data.vpaid_message_stars().value_or_empty())); + MTP_long(data.vpaid_message_stars().value_or_empty()), + (data.vsuggested_post() + ? *data.vsuggested_post() + : MTPSuggestedPost())); }); } @@ -272,7 +275,8 @@ void ScheduledMessages::sendNowSimpleMessage( MTP_long(local->effectId()), // effect MTPFactCheck(), MTPint(), // report_delivery_until_date - MTPlong()), // paid_message_stars + MTPlong(), // paid_message_stars + MTPSuggestedPost()), localFlags, NewMessageType::Unread); diff --git a/Telegram/SourceFiles/data/data_session.cpp b/Telegram/SourceFiles/data/data_session.cpp index 490db7d8df..66ab04bab2 100644 --- a/Telegram/SourceFiles/data/data_session.cpp +++ b/Telegram/SourceFiles/data/data_session.cpp @@ -4950,7 +4950,8 @@ void Session::insertCheckedServiceNotification( MTPlong(), // effect MTPFactCheck(), MTPint(), // report_delivery_until_date - MTPlong()), // paid_message_stars + MTPlong(), // paid_message_stars + MTPSuggestedPost()), localFlags, NewMessageType::Unread); } diff --git a/Telegram/SourceFiles/export/data/export_data_types.cpp b/Telegram/SourceFiles/export/data/export_data_types.cpp index 8d13561903..52d79e4079 100644 --- a/Telegram/SourceFiles/export/data/export_data_types.cpp +++ b/Telegram/SourceFiles/export/data/export_data_types.cpp @@ -1757,6 +1757,14 @@ ServiceAction ParseServiceAction( | ranges::views::transform(ParseTodoListItem) | ranges::to_vector, }; + }, [&](const MTPDmessageActionSuggestedPostApproval &data) { + result.content = ActionSuggestedPostApproval{ + .rejectComment = data.vreject_comment().value_or_empty(), + .scheduleDate = data.vschedule_date().value_or_empty(), + .stars = int(data.vstars_amount().value_or_empty()), + .rejected = data.is_rejected(), + .balanceTooLow = data.is_balance_too_low(), + }; }, [&](const MTPDmessageActionConferenceCall &data) { auto content = ActionPhoneCall(); using State = ActionPhoneCall::State; diff --git a/Telegram/SourceFiles/export/data/export_data_types.h b/Telegram/SourceFiles/export/data/export_data_types.h index 6e7c873b28..38ba0d0cfe 100644 --- a/Telegram/SourceFiles/export/data/export_data_types.h +++ b/Telegram/SourceFiles/export/data/export_data_types.h @@ -698,6 +698,14 @@ struct ActionTodoAppendTasks { std::vector items; }; +struct ActionSuggestedPostApproval { + Utf8String rejectComment; + TimeId scheduleDate = 0; + int stars = 0; + bool rejected = false; + bool balanceTooLow = false; +}; + struct ServiceAction { std::variant< v::null_t, @@ -747,7 +755,8 @@ struct ServiceAction { ActionPaidMessagesRefunded, ActionPaidMessagesPrice, ActionTodoCompletions, - ActionTodoAppendTasks> content; + ActionTodoAppendTasks, + ActionSuggestedPostApproval> content; }; ServiceAction ParseServiceAction( diff --git a/Telegram/SourceFiles/export/output/export_output_html.cpp b/Telegram/SourceFiles/export/output/export_output_html.cpp index edb7d95adb..df2278f53c 100644 --- a/Telegram/SourceFiles/export/output/export_output_html.cpp +++ b/Telegram/SourceFiles/export/output/export_output_html.cpp @@ -1446,6 +1446,24 @@ auto HtmlWriter::Wrap::pushMessage( + """); } return serviceFrom + " added tasks: " + tasks.join(", "); + }, [&](const ActionSuggestedPostApproval &data) { + return serviceFrom + + (data.rejected ? " rejected " : " approved ") + + "your suggested post" + + (data.stars + ? ", for " + QString::number(data.stars).toUtf8() + " stars" + : "") + + (data.scheduleDate + ? (", " + + FormatDateText(data.scheduleDate) + + " at " + + FormatTimeText(data.scheduleDate)) + : "") + + (data.rejectComment.isEmpty() + ? "." + : (", with comment: "" + + SerializeString(data.rejectComment) + + """)); }, [](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 ec57f7f83a..7eb927f866 100644 --- a/Telegram/SourceFiles/export/output/export_output_json.cpp +++ b/Telegram/SourceFiles/export/output/export_output_json.cpp @@ -708,6 +708,18 @@ QByteArray SerializeMessage( return result; }) | ranges::to_vector; pushBare("items", SerializeArray(context, items)); + }, [&](const ActionSuggestedPostApproval &data) { + pushActor(); + pushAction("process_suggested_post"); + if (data.rejected) { + pushBare("rejected", "true"); + if (!data.rejectComment.isEmpty()) { + push("comment", data.rejectComment); + } + } else { + push("stars_amount", NumberToString(data.stars)); + push("scheduled_date", data.scheduleDate); + } }, [](v::null_t) {}); if (v::is_null(message.action.content)) { 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 abe3d949c5..a93d1d1925 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp @@ -163,7 +163,8 @@ MTPMessage PrepareLogMessage(const MTPMessage &message, TimeId newDate) { | Flag::f_restriction_reason | Flag::f_ttl_period | Flag::f_factcheck - | Flag::f_report_delivery_until_date; + | Flag::f_report_delivery_until_date + | Flag::f_suggested_post; return MTP_message( MTP_flags(data.vflags().v & ~removeFlags), data.vid(), @@ -195,7 +196,8 @@ MTPMessage PrepareLogMessage(const MTPMessage &message, TimeId newDate) { MTP_long(data.veffect().value_or_empty()), MTPFactCheck(), MTPint(), // report_delivery_until_date - MTP_long(data.vpaid_message_stars().value_or_empty())); + MTP_long(data.vpaid_message_stars().value_or_empty()), + MTPSuggestedPost()); }); } diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 18dfcba072..2df23d25f6 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -5913,6 +5913,10 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) { return prepareTodoAppendTasksText(); }; + auto prepareSuggestedPostApproval = [&](const MTPDmessageActionSuggestedPostApproval &) { + return PreparedServiceText{ { "process_suggested" } }; AssertIsDebug(); + }; + auto prepareConferenceCall = [&](const MTPDmessageActionConferenceCall &) -> PreparedServiceText { Unexpected("PhoneCall type in setServiceMessageFromMtp."); }; @@ -5969,6 +5973,7 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) { prepareConferenceCall, prepareTodoCompletions, prepareTodoAppendTasks, + prepareSuggestedPostApproval, PrepareEmptyText, PrepareErrorText)); diff --git a/Telegram/SourceFiles/media/stories/media_stories_share.cpp b/Telegram/SourceFiles/media/stories/media_stories_share.cpp index 80ec8e75ba..4773e7e068 100644 --- a/Telegram/SourceFiles/media/stories/media_stories_share.cpp +++ b/Telegram/SourceFiles/media/stories/media_stories_share.cpp @@ -135,6 +135,9 @@ namespace Media::Stories { if (options.effectId) { sendFlags |= SendFlag::f_effect; } + if (options.suggest) { + sendFlags |= SendFlag::f_suggested_post; + } if (options.invertCaption) { sendFlags |= SendFlag::f_invert_media; } @@ -170,7 +173,8 @@ namespace Media::Stories { MTP_inputPeerEmpty(), Data::ShortcutIdToMTP(session, options.shortcutId), MTP_long(options.effectId), - MTP_long(starsPaid) + MTP_long(starsPaid), + SuggestToMTP(options.suggest) ), [=]( const MTPUpdates &result, const MTP::Response &response) { diff --git a/Telegram/SourceFiles/mtproto/scheme/api.tl b/Telegram/SourceFiles/mtproto/scheme/api.tl index eacd073501..55fcec1aa4 100644 --- a/Telegram/SourceFiles/mtproto/scheme/api.tl +++ b/Telegram/SourceFiles/mtproto/scheme/api.tl @@ -117,7 +117,7 @@ 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#eabcdd4d 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 noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true video_processing_pending:flags2.4?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?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 reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck report_delivery_until_date:flags2.5?int paid_message_stars:flags2.6?long = Message; +message#9815cec8 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 noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true video_processing_pending:flags2.4?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?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 reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck report_delivery_until_date:flags2.5?int paid_message_stars:flags2.6?long suggested_post:flags2.7?SuggestedPost = Message; 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; @@ -192,6 +192,7 @@ messageActionPaidMessagesPrice#84b88578 flags:# broadcast_messages_allowed:flags messageActionConferenceCall#2ffe2f7a flags:# missed:flags.0?true active:flags.1?true video:flags.4?true call_id:long duration:flags.2?int other_participants:flags.3?Vector = MessageAction; messageActionTodoCompletions#cc7c5c89 completed:Vector incompleted:Vector = MessageAction; messageActionTodoAppendTasks#c7edbc83 list:Vector = MessageAction; +messageActionSuggestedPostApproval#af42ae29 flags:# rejected:flags.0?true balance_too_low:flags.1?true reject_comment:flags.2?string schedule_date:flags.3?int stars_amount:flags.4?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; @@ -1993,6 +1994,8 @@ todoList#49b92a26 flags:# others_can_append:flags.0?true others_can_complete:fla todoCompletion#4cc120b7 id:int completed_by:long date:int = TodoCompletion; +suggestedPost#95ee6a6d flags:# accepted:flags.1?true rejected:flags.2?true stars_amount:long schedule_date:flags.0?int = SuggestedPost; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -2189,8 +2192,8 @@ messages.deleteHistory#b08f922a flags:# just_clear:flags.0?true revoke:flags.1?t messages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector = messages.AffectedMessages; messages.receivedMessages#5a954c0 max_id:int = Vector; messages.setTyping#58943ee2 flags:# peer:InputPeer top_msg_id:flags.0?int action:SendMessageAction = Bool; -messages.sendMessage#fbf2340a flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long = Updates; -messages.sendMedia#a550cd78 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long = Updates; +messages.sendMessage#fe05dc9a flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long suggested_post:flags.22?SuggestedPost = Updates; +messages.sendMedia#ac55d9c1 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long suggested_post:flags.22?SuggestedPost = Updates; messages.forwardMessages#38f0188c flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true allow_paid_floodskip:flags.19?true from_peer:InputPeer id:Vector random_id:Vector to_peer:InputPeer top_msg_id:flags.9?int reply_to:flags.22?InputReplyTo schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut video_timestamp:flags.20?int allow_paid_stars:flags.21?long = Updates; messages.reportSpam#cf1592db peer:InputPeer = Bool; messages.getPeerSettings#efd9a6a2 peer:InputPeer = messages.PeerSettings; @@ -2409,6 +2412,7 @@ messages.getSavedDialogsByID#6f6f9c96 flags:# parent_peer:flags.1?InputPeer ids: messages.readSavedHistory#ba4a3b5b parent_peer:InputPeer peer:InputPeer max_id:int = Bool; messages.toggleTodoCompleted#d3e03124 peer:InputPeer msg_id:int completed:Vector incompleted:Vector = Updates; messages.appendTodoList#21a61057 peer:InputPeer msg_id:int list:Vector = Updates; +messages.toggleSuggestedPostApproval#8107455c flags:# reject:flags.1?true peer:InputPeer msg_id:int schedule_date:flags.0?int reject_comment:flags.2?string = 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; @@ -2726,4 +2730,4 @@ smsjobs.finishJob#4f1ebf24 flags:# job_id:string error:flags.0?string = Bool; fragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo; -// LAYER 205 +// LAYER 206 diff --git a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp index c64c2c5ccc..5ce93e02bb 100644 --- a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp +++ b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp @@ -204,7 +204,8 @@ AdminLog::OwnedItem GenerateForwardedItem( MTPlong(), // effect MTPFactCheck(), MTPint(), // report_delivery_until_date - MTPlong() // paid_message_stars + MTPlong(), // paid_message_stars + MTPSuggestedPost() ).match([&](const MTPDmessage &data) { return history->makeMessage( history->nextNonHistoryEntryId(), diff --git a/Telegram/SourceFiles/window/window_peer_menu.cpp b/Telegram/SourceFiles/window/window_peer_menu.cpp index e806bf7c7d..3913b1b3c9 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.cpp +++ b/Telegram/SourceFiles/window/window_peer_menu.cpp @@ -150,7 +150,8 @@ void ShareBotGame( MTPInputPeer(), // send_as MTPInputQuickReplyShortcut(), MTPlong(), - MTPlong() + MTPlong(), + MTPSuggestedPost() ), [=](const MTPUpdates &, const MTP::Response &) { }, [=](const MTP::Error &error, const MTP::Response &) { history->session().api().sendMessageFail(error, history->peer);