From c4d5d52b96c6a49e0dbee2113c0541da338787eb Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 6 Oct 2025 13:51:09 +0400 Subject: [PATCH] Update API scheme to layer 217. --- Telegram/SourceFiles/api/api_common.h | 1 + Telegram/SourceFiles/api/api_editing.cpp | 5 +++++ Telegram/SourceFiles/api/api_polls.cpp | 5 +++++ Telegram/SourceFiles/api/api_sending.cpp | 12 ++++++++++ Telegram/SourceFiles/api/api_todo_lists.cpp | 4 ++++ Telegram/SourceFiles/api/api_updates.cpp | 6 +++-- Telegram/SourceFiles/apiwrap.cpp | 22 +++++++++++++++++++ .../SourceFiles/boxes/add_contact_box.cpp | 4 +++- Telegram/SourceFiles/boxes/share_box.cpp | 4 ++++ .../calls/group/calls_group_rtmp.cpp | 1 + .../calls/group/calls_group_settings.cpp | 1 + .../data/business/data_shortcut_messages.cpp | 3 ++- .../data/components/scheduled_messages.cpp | 6 +++-- Telegram/SourceFiles/data/data_group_call.cpp | 6 ++--- Telegram/SourceFiles/data/data_session.cpp | 3 ++- .../export/data/export_data_types.cpp | 2 ++ .../admin_log/history_admin_log_item.cpp | 3 ++- Telegram/SourceFiles/history/history_item.cpp | 3 +++ .../history/history_item_helpers.cpp | 2 ++ .../media/stories/media_stories_share.cpp | 4 ++++ Telegram/SourceFiles/mtproto/scheme/api.tl | 20 +++++++++-------- .../settings/settings_privacy_controllers.cpp | 3 ++- .../SourceFiles/window/window_peer_menu.cpp | 3 ++- 23 files changed, 100 insertions(+), 23 deletions(-) diff --git a/Telegram/SourceFiles/api/api_common.h b/Telegram/SourceFiles/api/api_common.h index bbbff2b0cc..9435b8bfca 100644 --- a/Telegram/SourceFiles/api/api_common.h +++ b/Telegram/SourceFiles/api/api_common.h @@ -25,6 +25,7 @@ struct SendOptions { uint64 price = 0; PeerData *sendAs = nullptr; TimeId scheduled = 0; + TimeId scheduleRepeatPeriod = 0; BusinessShortcutId shortcutId = 0; EffectId effectId = 0; int starsApproved = 0; diff --git a/Telegram/SourceFiles/api/api_editing.cpp b/Telegram/SourceFiles/api/api_editing.cpp index e3ec52e172..c3afa0b728 100644 --- a/Telegram/SourceFiles/api/api_editing.cpp +++ b/Telegram/SourceFiles/api/api_editing.cpp @@ -154,6 +154,7 @@ mtpRequestId SuggestMedia( MTPReplyMarkup(), sentEntities, MTPint(), // schedule_date + MTPint(), // schedule_repeat_period MTPInputPeer(), // send_as MTPInputQuickReplyShortcut(), // quick_reply_shortcut MTPlong(), // effect @@ -295,6 +296,9 @@ mtpRequestId EditMessage( | (options.scheduled ? MTPmessages_EditMessage::Flag::f_schedule_date : emptyFlag) + | ((options.scheduled && options.scheduleRepeatPeriod) + ? MTPmessages_EditMessage::Flag::f_schedule_repeat_period + : emptyFlag) | (item->isBusinessShortcut() ? MTPmessages_EditMessage::Flag::f_quick_reply_shortcut_id : emptyFlag); @@ -313,6 +317,7 @@ mtpRequestId EditMessage( MTPReplyMarkup(), sentEntities, MTP_int(options.scheduled), + MTP_int(options.scheduleRepeatPeriod), MTP_int(item->shortcutId()) )).done([=]( const MTPUpdates &result, diff --git a/Telegram/SourceFiles/api/api_polls.cpp b/Telegram/SourceFiles/api/api_polls.cpp index f091949b1a..64e2ad6664 100644 --- a/Telegram/SourceFiles/api/api_polls.cpp +++ b/Telegram/SourceFiles/api/api_polls.cpp @@ -61,6 +61,9 @@ void Polls::create( } if (action.options.scheduled) { sendFlags |= MTPmessages_SendMedia::Flag::f_schedule_date; + if (action.options.scheduleRepeatPeriod) { + sendFlags |= MTPmessages_SendMedia::Flag::f_schedule_repeat_period; + } } if (action.options.shortcutId) { sendFlags |= MTPmessages_SendMedia::Flag::f_quick_reply_shortcut; @@ -95,6 +98,7 @@ void Polls::create( MTPReplyMarkup(), MTPVector(), MTP_int(action.options.scheduled), + MTP_int(action.options.scheduleRepeatPeriod), (sendAs ? sendAs->input : MTP_inputPeerEmpty()), Data::ShortcutIdToMTP(_session, action.options.shortcutId), MTP_long(action.options.effectId), @@ -191,6 +195,7 @@ void Polls::close(not_null item) { MTPReplyMarkup(), MTPVector(), MTP_int(0), // schedule_date + MTP_int(0), // schedule_repeat_period MTPint() // quick_reply_shortcut_id )).done([=](const MTPUpdates &result) { _pollCloseRequestIds.erase(itemId); diff --git a/Telegram/SourceFiles/api/api_sending.cpp b/Telegram/SourceFiles/api/api_sending.cpp index cbfa6a937d..a77cc1beb4 100644 --- a/Telegram/SourceFiles/api/api_sending.cpp +++ b/Telegram/SourceFiles/api/api_sending.cpp @@ -101,6 +101,9 @@ void SendSimpleMedia(SendAction action, MTPInputMedia inputMedia) { if (action.options.scheduled) { flags |= MessageFlag::IsOrWasScheduled; sendFlags |= MTPmessages_SendMedia::Flag::f_schedule_date; + if (action.options.scheduleRepeatPeriod) { + sendFlags |= MTPmessages_SendMedia::Flag::f_schedule_repeat_period; + } } if (action.options.shortcutId) { flags |= MessageFlag::ShortcutMessage; @@ -136,6 +139,7 @@ void SendSimpleMedia(SendAction action, MTPInputMedia inputMedia) { MTPReplyMarkup(), MTPvector(), MTP_int(action.options.scheduled), + MTP_int(action.options.scheduleRepeatPeriod), (sendAs ? sendAs->input : MTP_inputPeerEmpty()), Data::ShortcutIdToMTP(session, action.options.shortcutId), MTP_long(action.options.effectId), @@ -207,6 +211,9 @@ void SendExistingMedia( if (action.options.scheduled) { flags |= MessageFlag::IsOrWasScheduled; sendFlags |= MTPmessages_SendMedia::Flag::f_schedule_date; + if (action.options.scheduleRepeatPeriod) { + sendFlags |= MTPmessages_SendMedia::Flag::f_schedule_repeat_period; + } } if (action.options.shortcutId) { flags |= MessageFlag::ShortcutMessage; @@ -260,6 +267,7 @@ void SendExistingMedia( MTPReplyMarkup(), sentEntities, MTP_int(action.options.scheduled), + MTP_int(action.options.scheduleRepeatPeriod), (sendAs ? sendAs->input : MTP_inputPeerEmpty()), Data::ShortcutIdToMTP(session, action.options.shortcutId), MTP_long(action.options.effectId), @@ -392,6 +400,9 @@ bool SendDice(MessageToSend &message) { if (action.options.scheduled) { flags |= MessageFlag::IsOrWasScheduled; sendFlags |= MTPmessages_SendMedia::Flag::f_schedule_date; + if (action.options.scheduleRepeatPeriod) { + sendFlags |= MTPmessages_SendMedia::Flag::f_schedule_repeat_period; + } } if (action.options.shortcutId) { flags |= MessageFlag::ShortcutMessage; @@ -445,6 +456,7 @@ bool SendDice(MessageToSend &message) { MTPReplyMarkup(), MTP_vector(), MTP_int(action.options.scheduled), + MTP_int(action.options.scheduleRepeatPeriod), (sendAs ? sendAs->input : MTP_inputPeerEmpty()), Data::ShortcutIdToMTP(session, action.options.shortcutId), MTP_long(action.options.effectId), diff --git a/Telegram/SourceFiles/api/api_todo_lists.cpp b/Telegram/SourceFiles/api/api_todo_lists.cpp index 7471f55846..192df853bd 100644 --- a/Telegram/SourceFiles/api/api_todo_lists.cpp +++ b/Telegram/SourceFiles/api/api_todo_lists.cpp @@ -66,6 +66,9 @@ void TodoLists::create( } if (action.options.scheduled) { sendFlags |= MTPmessages_SendMedia::Flag::f_schedule_date; + if (action.options.scheduleRepeatPeriod) { + sendFlags |= MTPmessages_SendMedia::Flag::f_schedule_repeat_period; + } } if (action.options.shortcutId) { sendFlags |= MTPmessages_SendMedia::Flag::f_quick_reply_shortcut; @@ -100,6 +103,7 @@ void TodoLists::create( MTPReplyMarkup(), MTPVector(), MTP_int(action.options.scheduled), + MTP_int(action.options.scheduleRepeatPeriod), (sendAs ? sendAs->input : MTP_inputPeerEmpty()), Data::ShortcutIdToMTP(_session, action.options.shortcutId), MTP_long(action.options.effectId), diff --git a/Telegram/SourceFiles/api/api_updates.cpp b/Telegram/SourceFiles/api/api_updates.cpp index 4326245720..ddf317c61a 100644 --- a/Telegram/SourceFiles/api/api_updates.cpp +++ b/Telegram/SourceFiles/api/api_updates.cpp @@ -1234,7 +1234,8 @@ void Updates::applyUpdatesNoPtsCheck(const MTPUpdates &updates) { MTPFactCheck(), MTPint(), // report_delivery_until_date MTPlong(), // paid_message_stars - MTPSuggestedPost()), + MTPSuggestedPost(), + MTPint()), // schedule_repeat_period MessageFlags(), NewMessageType::Unread); } break; @@ -1274,7 +1275,8 @@ void Updates::applyUpdatesNoPtsCheck(const MTPUpdates &updates) { MTPFactCheck(), MTPint(), // report_delivery_until_date MTPlong(), // paid_message_stars - MTPSuggestedPost()), + MTPSuggestedPost(), + MTPint()), // schedule_repeat_period MessageFlags(), NewMessageType::Unread); } break; diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 300559b6e2..81a84b77cb 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -3473,6 +3473,9 @@ void ApiWrap::forwardMessages( if (action.options.scheduled) { flags |= MessageFlag::IsOrWasScheduled; sendFlags |= SendFlag::f_schedule_date; + if (action.options.scheduleRepeatPeriod) { + sendFlags |= SendFlag::f_schedule_repeat_period; + } } if (action.options.shortcutId) { flags |= MessageFlag::ShortcutMessage; @@ -3540,6 +3543,7 @@ void ApiWrap::forwardMessages( ? MTP_inputReplyToMonoForum(monoforumPeer->input) : MTPInputReplyTo()), MTP_int(action.options.scheduled), + MTP_int(action.options.scheduleRepeatPeriod), (sendAs ? sendAs->input : MTP_inputPeerEmpty()), Data::ShortcutIdToMTP(_session, action.options.shortcutId), MTPint(), // video_timestamp @@ -4064,6 +4068,10 @@ void ApiWrap::sendMessage( flags |= MessageFlag::IsOrWasScheduled; sendFlags |= MTPmessages_SendMessage::Flag::f_schedule_date; mediaFlags |= MTPmessages_SendMedia::Flag::f_schedule_date; + if (action.options.scheduleRepeatPeriod) { + sendFlags |= MTPmessages_SendMessage::Flag::f_schedule_repeat_period; + mediaFlags |= MTPmessages_SendMedia::Flag::f_schedule_repeat_period; + } } if (action.options.shortcutId) { flags |= MessageFlag::ShortcutMessage; @@ -4143,6 +4151,7 @@ void ApiWrap::sendMessage( MTPReplyMarkup(), sentEntities, MTP_int(action.options.scheduled), + MTP_int(action.options.scheduleRepeatPeriod), (sendAs ? sendAs->input : MTP_inputPeerEmpty()), mtpShortcut, MTP_long(action.options.effectId), @@ -4163,6 +4172,7 @@ void ApiWrap::sendMessage( MTPReplyMarkup(), sentEntities, MTP_int(action.options.scheduled), + MTP_int(action.options.scheduleRepeatPeriod), (sendAs ? sendAs->input : MTP_inputPeerEmpty()), mtpShortcut, MTP_long(action.options.effectId), @@ -4470,6 +4480,9 @@ void ApiWrap::sendMediaWithRandomId( : Flag(0)) | (!sentEntities.v.isEmpty() ? Flag::f_entities : Flag(0)) | (options.scheduled ? Flag::f_schedule_date : Flag(0)) + | ((options.scheduled && options.scheduleRepeatPeriod) + ? Flag::f_schedule_repeat_period + : Flag(0)) | (options.sendAs ? Flag::f_send_as : Flag(0)) | (options.shortcutId ? Flag::f_quick_reply_shortcut : Flag(0)) | (options.effectId ? Flag::f_effect : Flag(0)) @@ -4499,6 +4512,7 @@ void ApiWrap::sendMediaWithRandomId( MTPReplyMarkup(), sentEntities, MTP_int(options.scheduled), + MTP_int(options.scheduleRepeatPeriod), (options.sendAs ? options.sendAs->input : MTP_inputPeerEmpty()), Data::ShortcutIdToMTP(_session, options.shortcutId), MTP_long(options.effectId), @@ -4555,6 +4569,9 @@ void ApiWrap::sendMultiPaidMedia( : Flag(0)) | (!sentEntities.v.isEmpty() ? Flag::f_entities : Flag(0)) | (options.scheduled ? Flag::f_schedule_date : Flag(0)) + | (options.scheduleRepeatPeriod + ? Flag::f_schedule_repeat_period + : Flag(0)) | (options.sendAs ? Flag::f_send_as : Flag(0)) | (options.shortcutId ? Flag::f_quick_reply_shortcut : Flag(0)) | (options.effectId ? Flag::f_effect : Flag(0)) @@ -4583,6 +4600,7 @@ void ApiWrap::sendMultiPaidMedia( MTPReplyMarkup(), sentEntities, MTP_int(options.scheduled), + MTP_int(options.scheduleRepeatPeriod), (options.sendAs ? options.sendAs->input : MTP_inputPeerEmpty()), Data::ShortcutIdToMTP(_session, options.shortcutId), MTP_long(options.effectId), @@ -4690,6 +4708,9 @@ void ApiWrap::sendAlbumIfReady(not_null album) { ? Flag::f_silent : Flag(0)) | (album->options.scheduled ? Flag::f_schedule_date : Flag(0)) + //| (album->options.scheduleRepeatPeriod + // ? Flag::f_schedule_repeat_period + // : Flag(0)) | (sendAs ? Flag::f_send_as : Flag(0)) | (album->options.shortcutId ? Flag::f_quick_reply_shortcut @@ -4710,6 +4731,7 @@ void ApiWrap::sendAlbumIfReady(not_null album) { Data::Histories::ReplyToPlaceholder(), MTP_vector(medias), MTP_int(album->options.scheduled), + //MTP_int(album->options.scheduleRepeatPeriod), (sendAs ? sendAs->input : MTP_inputPeerEmpty()), Data::ShortcutIdToMTP(_session, album->options.shortcutId), MTP_long(album->options.effectId), diff --git a/Telegram/SourceFiles/boxes/add_contact_box.cpp b/Telegram/SourceFiles/boxes/add_contact_box.cpp index a6b4c555ea..72e71e0ba7 100644 --- a/Telegram/SourceFiles/boxes/add_contact_box.cpp +++ b/Telegram/SourceFiles/boxes/add_contact_box.cpp @@ -458,10 +458,12 @@ void AddContactBox::save() { MTP_vector( 1, MTP_inputPhoneContact( + MTP_flags(0), MTP_long(_contactId), MTP_string(phone), MTP_string(firstName), - MTP_string(lastName))) + MTP_string(lastName), + MTPTextWithEntities())) // note )).done(crl::guard(weak, [=]( const MTPcontacts_ImportedContacts &result) { const auto &data = result.data(); diff --git a/Telegram/SourceFiles/boxes/share_box.cpp b/Telegram/SourceFiles/boxes/share_box.cpp index 45472238d6..f9d4b7368f 100644 --- a/Telegram/SourceFiles/boxes/share_box.cpp +++ b/Telegram/SourceFiles/boxes/share_box.cpp @@ -1707,6 +1707,9 @@ ShareBox::SubmitCallback ShareBox::DefaultForwardCallback( const auto commonSendFlags = Flag(0) | Flag::f_with_my_score | (options.scheduled ? Flag::f_schedule_date : Flag(0)) + | ((options.scheduled && options.scheduleRepeatPeriod) + ? Flag::f_schedule_repeat_period + : Flag(0)) | ((forwardOptions != Data::ForwardOptions::PreserveInfo) ? Flag::f_drop_author : Flag(0)) @@ -1786,6 +1789,7 @@ ShareBox::SubmitCallback ShareBox::DefaultForwardCallback( ? MTP_inputReplyToMonoForum(sublistPeer->input) : MTPInputReplyTo()), MTP_int(options.scheduled), + MTP_int(options.scheduleRepeatPeriod), MTP_inputPeerEmpty(), // send_as Data::ShortcutIdToMTP(session, options.shortcutId), MTP_int(videoTimestamp.value_or(0)), diff --git a/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp b/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp index 5d5dcc0979..f8842f9ee5 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp @@ -160,6 +160,7 @@ void StartRtmpProcess::close() { void StartRtmpProcess::requestUrl(bool revoke) { const auto session = &_request->peer->session(); _request->id = session->api().request(MTPphone_GetGroupCallStreamRtmpUrl( + MTP_flags(0), _request->peer->input, MTP_bool(revoke) )).done([=](const MTPphone_GroupCallStreamRtmpUrl &result) { diff --git a/Telegram/SourceFiles/calls/group/calls_group_settings.cpp b/Telegram/SourceFiles/calls/group/calls_group_settings.cpp index 3c653c5e2e..7b77968d5f 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_settings.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_settings.cpp @@ -690,6 +690,7 @@ void SettingsBox( const auto session = &peer->session(); state->requestId = session->api().request( MTPphone_GetGroupCallStreamRtmpUrl( + MTP_flags(0), peer->input, MTP_bool(true) )).done([=](const MTPphone_GroupCallStreamRtmpUrl &result) { diff --git a/Telegram/SourceFiles/data/business/data_shortcut_messages.cpp b/Telegram/SourceFiles/data/business/data_shortcut_messages.cpp index e3701b18b9..6cb4890973 100644 --- a/Telegram/SourceFiles/data/business/data_shortcut_messages.cpp +++ b/Telegram/SourceFiles/data/business/data_shortcut_messages.cpp @@ -96,7 +96,8 @@ constexpr auto kRequestTimeLimit = 60 * crl::time(1000); MTP_long(data.vpaid_message_stars().value_or_empty()), (data.vsuggested_post() ? *data.vsuggested_post() - : MTPSuggestedPost())); + : MTPSuggestedPost()), + MTP_int(data.vschedule_repeat_period().value_or_empty())); }); } diff --git a/Telegram/SourceFiles/data/components/scheduled_messages.cpp b/Telegram/SourceFiles/data/components/scheduled_messages.cpp index 493a3cc36f..15e036dba9 100644 --- a/Telegram/SourceFiles/data/components/scheduled_messages.cpp +++ b/Telegram/SourceFiles/data/components/scheduled_messages.cpp @@ -100,7 +100,8 @@ constexpr auto kRequestTimeLimit = 60 * crl::time(1000); MTP_long(data.vpaid_message_stars().value_or_empty()), (data.vsuggested_post() ? *data.vsuggested_post() - : MTPSuggestedPost())); + : MTPSuggestedPost()), + MTP_int(data.vschedule_repeat_period().value_or_empty())); }); } @@ -276,7 +277,8 @@ void ScheduledMessages::sendNowSimpleMessage( MTPFactCheck(), MTPint(), // report_delivery_until_date MTPlong(), // paid_message_stars - MTPSuggestedPost()), + MTPSuggestedPost(), + MTPint()), // schedule_repeat_period localFlags, NewMessageType::Unread); diff --git a/Telegram/SourceFiles/data/data_group_call.cpp b/Telegram/SourceFiles/data/data_group_call.cpp index d411ad7c1a..6ac868018a 100644 --- a/Telegram/SourceFiles/data/data_group_call.cpp +++ b/Telegram/SourceFiles/data/data_group_call.cpp @@ -450,10 +450,8 @@ void GroupCall::discard(const MTPDgroupCallDiscarded &data) { Core::App().calls().applyGroupCallUpdateChecked( &peer->session(), MTP_updateGroupCall( - MTP_flags(MTPDupdateGroupCall::Flag::f_chat_id), - MTP_long(peer->isChat() - ? peerToChat(peer->id).bare - : peerToChannel(peer->id).bare), + MTP_flags(MTPDupdateGroupCall::Flag::f_peer), + peerToMTP(peer->id), MTP_groupCallDiscarded( data.vid(), data.vaccess_hash(), diff --git a/Telegram/SourceFiles/data/data_session.cpp b/Telegram/SourceFiles/data/data_session.cpp index 9e6b8e2ed7..2325202eb8 100644 --- a/Telegram/SourceFiles/data/data_session.cpp +++ b/Telegram/SourceFiles/data/data_session.cpp @@ -5101,7 +5101,8 @@ void Session::insertCheckedServiceNotification( MTPFactCheck(), MTPint(), // report_delivery_until_date MTPlong(), // paid_message_stars - MTPSuggestedPost()), + MTPSuggestedPost(), + MTPint()), // schedule_repeat_period localFlags, NewMessageType::Unread); } diff --git a/Telegram/SourceFiles/export/data/export_data_types.cpp b/Telegram/SourceFiles/export/data/export_data_types.cpp index 39f4d9a9f4..25619433b2 100644 --- a/Telegram/SourceFiles/export/data/export_data_types.cpp +++ b/Telegram/SourceFiles/export/data/export_data_types.cpp @@ -1436,6 +1436,8 @@ Media ParseMedia( result.content = ParseGiveaway(data); }, [&](const MTPDmessageMediaPaidMedia &data) { result.content = ParsePaidMedia(context, data, folder, date); + }, [](const MTPDmessageMediaVideoStream &data) { + // Live stories. }, [](const MTPDmessageMediaEmpty &data) {}); return result; } 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 3c6f878de1..8fc74f97e2 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp @@ -198,7 +198,8 @@ MTPMessage PrepareLogMessage(const MTPMessage &message, TimeId newDate) { MTPFactCheck(), MTPint(), // report_delivery_until_date MTP_long(data.vpaid_message_stars().value_or_empty()), - MTPSuggestedPost()); + MTPSuggestedPost(), + MTPint()); // schedule_repeat_period }); } diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 3d164e451e..58fec04dd2 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -384,6 +384,9 @@ std::unique_ptr HistoryItem::CreateMedia( return std::make_unique( item, Data::ComputeInvoiceData(item, media)); + }, [](const MTPDmessageMediaVideoStream &) -> Result { + // Live stories. + return nullptr; }, [](const MTPDmessageMediaEmpty &) -> Result { return nullptr; }, [](const MTPDmessageMediaUnsupported &) -> Result { diff --git a/Telegram/SourceFiles/history/history_item_helpers.cpp b/Telegram/SourceFiles/history/history_item_helpers.cpp index 762419f53a..5ccdc5e4f5 100644 --- a/Telegram/SourceFiles/history/history_item_helpers.cpp +++ b/Telegram/SourceFiles/history/history_item_helpers.cpp @@ -994,6 +994,8 @@ MediaCheckResult CheckMessageMedia(const MTPMessageMedia &media) { return Result::Good; }, [](const MTPDmessageMediaPaidMedia &) { return Result::Good; + }, [](const MTPDmessageMediaVideoStream &) { + return Result::Good; }, [](const MTPDmessageMediaUnsupported &) { return Result::Unsupported; }); diff --git a/Telegram/SourceFiles/media/stories/media_stories_share.cpp b/Telegram/SourceFiles/media/stories/media_stories_share.cpp index 7419a6715e..2529929772 100644 --- a/Telegram/SourceFiles/media/stories/media_stories_share.cpp +++ b/Telegram/SourceFiles/media/stories/media_stories_share.cpp @@ -128,6 +128,9 @@ namespace Media::Stories { } if (options.scheduled) { sendFlags |= SendFlag::f_schedule_date; + if (options.scheduleRepeatPeriod) { + sendFlags |= SendFlag::f_schedule_repeat_period; + } } if (options.shortcutId) { sendFlags |= SendFlag::f_quick_reply_shortcut; @@ -170,6 +173,7 @@ namespace Media::Stories { MTPReplyMarkup(), MTPVector(), MTP_int(options.scheduled), + MTP_int(options.scheduleRepeatPeriod), MTP_inputPeerEmpty(), Data::ShortcutIdToMTP(session, options.shortcutId), MTP_long(options.effectId), diff --git a/Telegram/SourceFiles/mtproto/scheme/api.tl b/Telegram/SourceFiles/mtproto/scheme/api.tl index 6fd55123dd..15eb50a195 100644 --- a/Telegram/SourceFiles/mtproto/scheme/api.tl +++ b/Telegram/SourceFiles/mtproto/scheme/api.tl @@ -22,7 +22,7 @@ inputUserSelf#f7c1b13f = 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; +inputPhoneContact#6a1dc4be flags:# client_id:long phone:string first_name:string last_name:string note:flags.0?TextWithEntities = InputContact; inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile; inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile; @@ -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#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 paid_suggested_post_stars:flags2.8?true paid_suggested_post_ton:flags2.9?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; +message#b92f76cf 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 paid_suggested_post_stars:flags2.8?true paid_suggested_post_ton:flags2.9?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 schedule_repeat_period:flags2.10?int = 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; @@ -138,6 +138,7 @@ messageMediaGiveaway#aa073beb flags:# only_new_subscribers:flags.0?true winners_ messageMediaGiveawayResults#ceaa3ea1 flags:# only_new_subscribers:flags.0?true refunded:flags.2?true channel_id:long additional_peers_count:flags.3?int launch_msg_id:int winners_count:int unclaimed_count:int winners:Vector months:flags.4?int stars:flags.5?long prize_description:flags.1?string until_date:int = MessageMedia; messageMediaPaidMedia#a8852491 stars_amount:long extended_media:Vector = MessageMedia; messageMediaToDo#8a53b014 flags:# todo:TodoList completions:flags.0?Vector = MessageMedia; +messageMediaVideoStream#3f237b91 call:InputGroupCall = MessageMedia; messageActionEmpty#b6aef7b0 = MessageAction; messageActionChatCreate#bd47cbad title:string users:Vector = MessageAction; @@ -385,7 +386,7 @@ updatePinnedMessages#ed85eab5 flags:# pinned:flags.0?true peer:Peer messages:Vec 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#97d64341 flags:# chat_id:flags.0?long call:GroupCall = Update; +updateGroupCall#9d2216e0 flags:# live_story:flags.2?true peer:flags.1?Peer call:GroupCall = Update; updatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?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:# via_chatlist:flags.3?true 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; @@ -2250,9 +2251,9 @@ 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#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#978928ca 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 suggested_post:flags.23?SuggestedPost = Updates; +messages.sendMessage#545cd15a 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 schedule_repeat_period:flags.24?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#330e77f 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 schedule_repeat_period:flags.24?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#41d41ade 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 schedule_repeat_period:flags.24?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut video_timestamp:flags.20?int allow_paid_stars:flags.21?long suggested_post:flags.23?SuggestedPost = Updates; messages.reportSpam#cf1592db peer:InputPeer = Bool; messages.getPeerSettings#efd9a6a2 peer:InputPeer = messages.PeerSettings; messages.report#fc78af9b peer:InputPeer id:Vector option:bytes message:string = ReportResult; @@ -2297,7 +2298,7 @@ messages.getInlineBotResults#514e999d flags:# bot:InputUser peer:InputPeer geo_p messages.setInlineBotResults#bb12a419 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 switch_webview:flags.4?InlineBotWebView = Bool; messages.sendInlineBotResult#c0cf7646 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to:flags.0?InputReplyTo random_id:long query_id:long id:string schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut allow_paid_stars:flags.21?long = Updates; messages.getMessageEditData#fda68d36 peer:InputPeer id:int = messages.MessageEditData; -messages.editMessage#dfd14005 flags:# no_webpage:flags.1?true invert_media:flags.16?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.15?int quick_reply_shortcut_id:flags.17?int = Updates; +messages.editMessage#51e842e1 flags:# no_webpage:flags.1?true invert_media:flags.16?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.15?int schedule_repeat_period:flags.18?int quick_reply_shortcut_id:flags.17?int = Updates; messages.editInlineBotMessage#83557dba flags:# no_webpage:flags.1?true invert_media:flags.16?true id:InputBotInlineMessageID message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector = Bool; messages.getBotCallbackAnswer#9342ca07 flags:# game:flags.1?true peer:InputPeer msg_id:int data:flags.0?bytes password:flags.2?InputCheckPasswordSRP = messages.BotCallbackAnswer; messages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long message:flags.0?string url:flags.2?string cache_time:int = Bool; @@ -2714,7 +2715,7 @@ phone.saveDefaultGroupCallJoinAs#575e1f8c peer:InputPeer join_as:InputPeer = Boo phone.joinGroupCallPresentation#cbea6bc4 call:InputGroupCall params:DataJSON = Updates; phone.leaveGroupCallPresentation#1c50d144 call:InputGroupCall = Updates; phone.getGroupCallStreamChannels#1ab21940 call:InputGroupCall = phone.GroupCallStreamChannels; -phone.getGroupCallStreamRtmpUrl#deb3abbf peer:InputPeer revoke:Bool = phone.GroupCallStreamRtmpUrl; +phone.getGroupCallStreamRtmpUrl#5af4c73a flags:# live_story:flags.0?true peer:InputPeer revoke:Bool = phone.GroupCallStreamRtmpUrl; phone.saveCallLog#41248786 peer:InputPhoneCall file:InputFile = Bool; phone.createConferenceCall#7d0444bb flags:# muted:flags.0?true video_stopped:flags.2?true join:flags.3?true random_id:int public_key:flags.3?int256 block:flags.3?bytes params:flags.3?DataJSON = Updates; phone.deleteConferenceCallParticipants#8ca60525 flags:# only_left:flags.0?true kick:flags.1?true call:InputGroupCall ids:Vector block:bytes = Updates; @@ -2785,6 +2786,7 @@ stories.reorderAlbums#8535fbd9 peer:InputPeer order:Vector = Bool; stories.deleteAlbum#8d3456d0 peer:InputPeer album_id:int = Bool; stories.getAlbums#25b3eac7 peer:InputPeer hash:long = stories.Albums; stories.getAlbumStories#ac806d61 peer:InputPeer album_id:int offset:int limit:int = stories.Stories; +stories.startLive#b2db821d flags:# pinned:flags.2?true noforwards:flags.4?true rtmp_stream:flags.5?true peer:InputPeer caption:flags.0?string entities:flags.1?Vector privacy_rules:Vector random_id:long = Updates; premium.getBoostsList#60f67660 flags:# gifts:flags.0?true peer:InputPeer offset:string limit:int = premium.BoostsList; premium.getMyBoosts#be77b4a = premium.MyBoosts; @@ -2802,4 +2804,4 @@ smsjobs.finishJob#4f1ebf24 flags:# job_id:string error:flags.0?string = Bool; fragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo; -// LAYER 216 +// LAYER 217 diff --git a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp index 5ce93e02bb..f2401ad5a6 100644 --- a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp +++ b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp @@ -205,7 +205,8 @@ AdminLog::OwnedItem GenerateForwardedItem( MTPFactCheck(), MTPint(), // report_delivery_until_date MTPlong(), // paid_message_stars - MTPSuggestedPost() + MTPSuggestedPost(), + MTPint() // schedule_repeat_period ).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 944b1e9dc4..45f52d032e 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.cpp +++ b/Telegram/SourceFiles/window/window_peer_menu.cpp @@ -156,7 +156,8 @@ void ShareBotGame( MTP_long(randomId), MTPReplyMarkup(), MTPVector(), - MTP_int(0), // schedule_date + MTPint(), // schedule_date + MTPint(), // schedule_repeat_period MTPInputPeer(), // send_as MTPInputQuickReplyShortcut(), MTPlong(),