diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index dd78fbb46..00814986b 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -1170,7 +1170,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_group_invite_members#other" = "{count} members, among them:"; "lng_channel_invite_private" = "This channel is private.\nPlease join it to continue viewing its content."; -"lng_group_invite_create" = "Create an invite link"; // #TODO links legacy +"lng_group_invite_create" = "Create an invite link"; "lng_group_invite_about_new" = "Your previous link will be deactivated and we'll generate a new invite link for you."; "lng_group_invite_copied" = "Invite link copied to clipboard."; "lng_group_invite_no_room" = "Unable to join this group because there are too many members in it already."; diff --git a/Telegram/Resources/tl/api.tl b/Telegram/Resources/tl/api.tl index 741268feb..45c0aa92c 100644 --- a/Telegram/Resources/tl/api.tl +++ b/Telegram/Resources/tl/api.tl @@ -127,8 +127,8 @@ chatForbidden#7328bdb id:int title:string = Chat; channel#d31a961e flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true id:int access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?Vector admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat; channelForbidden#289da732 flags:# broadcast:flags.5?true megagroup:flags.8?true id:int access_hash:long title:string until_date:flags.16?int = Chat; -chatFull#f3474af6 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:int about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall = ChatFull; -channelFull#7a7de4f7 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?int location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall = ChatFull; +chatFull#e22542a0 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:int about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl:flags.14?PeerHistoryTTL = ChatFull; +channelFull#fc048a06 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?int location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl:flags.24?PeerHistoryTTL = ChatFull; chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant; chatParticipantCreator#da13538a user_id:int = ChatParticipant; @@ -141,7 +141,7 @@ chatPhotoEmpty#37c1011c = ChatPhoto; chatPhoto#d20b9f3c flags:# has_video:flags.0?true photo_small:FileLocation photo_big:FileLocation dc_id:int = ChatPhoto; messageEmpty#90a6ca84 flags:# id:int peer_id:flags.0?Peer = Message; -message#58ae39c9 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector = Message; +message#bce383d2 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector ttl_period:flags.25?int = Message; messageService#286fa604 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction = Message; messageMediaEmpty#3ded6320 = MessageMedia; @@ -231,7 +231,7 @@ inputReportReasonCopyright#9b89f93a = ReportReason; inputReportReasonGeoIrrelevant#dbd4feed = ReportReason; inputReportReasonFake#f5ddd6e7 = ReportReason; -userFull#edf17c12 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int = UserFull; +userFull#a54475a7 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl:flags.14?PeerHistoryTTL = UserFull; contact#f911c994 user_id:int mutual:Bool = Contact; @@ -369,6 +369,7 @@ updatePinnedChannelMessages#8588878b flags:# pinned:flags.0?true channel_id:int updateChat#1330a196 chat_id:int = Update; updateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector version:int = Update; updateGroupCall#a45eb99b chat_id:int call:GroupCall = Update; +updatePeerHistoryTTL#1265be8 flags:# peer:Peer ttl:flags.0?PeerHistoryTTL = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -378,12 +379,12 @@ updates.differenceSlice#a8fb1981 new_messages:Vector new_encrypted_mess updates.differenceTooLong#4afe8f6d pts:int = updates.Difference; updatesTooLong#e317af7e = Updates; -updateShortMessage#2296d2c8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector = Updates; -updateShortChatMessage#402d5dbb flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector = Updates; +updateShortMessage#faeff833 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector ttl_period:flags.25?int = Updates; +updateShortChatMessage#1157b858 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector ttl_period:flags.25?int = Updates; updateShort#78d4dec1 update:Update date:int = Updates; updatesCombined#725b04c3 updates:Vector users:Vector chats:Vector date:int seq_start:int seq:int = Updates; updates#74ae4240 updates:Vector users:Vector chats:Vector date:int seq:int = Updates; -updateShortSentMessage#11f1331c flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector = Updates; +updateShortSentMessage#9015e101 flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector ttl_period:flags.25?int = Updates; photos.photos#8dca6aa5 photos:Vector users:Vector = photos.Photos; photos.photosSlice#15051f54 count:int photos:Vector users:Vector = photos.Photos; @@ -886,12 +887,18 @@ channelAdminLogEventActionDiscardGroupCall#db9f9140 call:InputGroupCall = Channe channelAdminLogEventActionParticipantMute#f92424d2 participant:GroupCallParticipant = ChannelAdminLogEventAction; channelAdminLogEventActionParticipantUnmute#e64429c0 participant:GroupCallParticipant = ChannelAdminLogEventAction; channelAdminLogEventActionToggleGroupCallSetting#56d6a247 join_muted:Bool = ChannelAdminLogEventAction; +channelAdminLogEventActionParticipantJoinByInvite#5cdada77 invite:ExportedChatInvite = ChannelAdminLogEventAction; +channelAdminLogEventActionExportedInviteDelete#5a50fca4 invite:ExportedChatInvite = ChannelAdminLogEventAction; +channelAdminLogEventActionExportedInviteRevoke#410a134e invite:ExportedChatInvite = ChannelAdminLogEventAction; +channelAdminLogEventActionExportedInviteEdit#e90ebb59 prev_invite:ExportedChatInvite new_invite:ExportedChatInvite = ChannelAdminLogEventAction; +channelAdminLogEventActionParticipantVolume#3e7f6847 participant:GroupCallParticipant = ChannelAdminLogEventAction; +channelAdminLogEventActionChangeHistoryTTL#6e941a38 prev_value:int new_value:int = ChannelAdminLogEventAction; channelAdminLogEvent#3b5a3e40 id:long date:int user_id:int action:ChannelAdminLogEventAction = ChannelAdminLogEvent; channels.adminLogResults#ed8af74d events:Vector chats:Vector users:Vector = channels.AdminLogResults; -channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true = ChannelAdminLogEventsFilter; +channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?true = ChannelAdminLogEventsFilter; popularContact#5ce14175 client_id:long importers:int = PopularContact; @@ -1214,6 +1221,22 @@ messages.historyImportParsed#5e0fb7b9 flags:# pm:flags.0?true group:flags.1?true messages.affectedFoundMessages#ef8d3e6c pts:int pts_count:int offset:int messages:Vector = messages.AffectedFoundMessages; +peerHistoryTTLPM#cf622d96 flags:# my_oneside:flags.0?true my_ttl_period:flags.1?int peer_ttl_period:flags.2?int = PeerHistoryTTL; +peerHistoryTTL#3e11cee9 ttl_period:int = PeerHistoryTTL; + +chatInviteImporter#1e3e6680 user_id:int date:int = ChatInviteImporter; + +messages.exportedChatInvites#bdc62dcc count:int invites:Vector users:Vector = messages.ExportedChatInvites; + +messages.exportedChatInvite#1871be50 invite:ExportedChatInvite users:Vector = messages.ExportedChatInvite; +messages.exportedChatInviteReplaced#222600ef invite:ExportedChatInvite new_invite:ExportedChatInvite users:Vector = messages.ExportedChatInvite; + +messages.chatInviteImporters#81b6b00a count:int importers:Vector users:Vector = messages.ChatInviteImporters; + +chatAdminWithInvites#deaa220c admin_id:int invites_count:int = ChatAdminWithInvites; + +messages.chatAdminsWithInvites#b69b72d7 admins:Vector users:Vector = messages.ChatAdminsWithInvites; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -1373,7 +1396,7 @@ messages.readMessageContents#36a73f77 id:Vector = messages.AffectedMessages messages.getStickers#43d4f2c emoticon:string hash:int = messages.Stickers; messages.getAllStickers#1c9618b1 hash:int = messages.AllStickers; messages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector = MessageMedia; -messages.exportChatInvite#df7534c peer:InputPeer = ExportedChatInvite; +messages.exportChatInvite#14b9bcd7 flags:# legacy_revoke_permanent:flags.2?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int = ExportedChatInvite; messages.checkChatInvite#3eadb1bb hash:string = ChatInvite; messages.importChatInvite#6c50051c hash:string = Updates; messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet; @@ -1469,6 +1492,13 @@ messages.checkHistoryImport#43fe19f3 import_head:string = messages.HistoryImport messages.initHistoryImport#34090c3b peer:InputPeer file:InputFile media_count:int = messages.HistoryImport; messages.uploadImportedMedia#2a862092 peer:InputPeer import_id:long file_name:string media:InputMedia = MessageMedia; messages.startHistoryImport#b43df344 peer:InputPeer import_id:long = Bool; +messages.getExportedChatInvites#a2b5a3f6 flags:# revoked:flags.3?true peer:InputPeer admin_id:InputUser offset_date:flags.2?int offset_link:flags.2?string limit:int = messages.ExportedChatInvites; +messages.editExportedChatInvite#2e4ffbe flags:# revoked:flags.2?true peer:InputPeer link:string expire_date:flags.0?int usage_limit:flags.1?int = messages.ExportedChatInvite; +messages.deleteRevokedExportedChatInvites#56987bd5 peer:InputPeer admin_id:InputUser = Bool; +messages.deleteExportedChatInvite#d464a42b peer:InputPeer link:string = Bool; +messages.getAdminsWithInvites#3920e6ef peer:InputPeer = messages.ChatAdminsWithInvites; +messages.getChatInviteImporters#26fb7289 peer:InputPeer link:string offset_date:int offset_user:InputUser limit:int = messages.ChatInviteImporters; +messages.setHistoryTTL#cccb4721 flags:# pm_oneside:flags.0?true peer:InputPeer period:int = Updates; updates.getState#edd4882a = updates.State; updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference; @@ -1600,4 +1630,4 @@ stats.getMegagroupStats#dcdf8607 flags:# dark:flags.0?true channel:InputChannel stats.getMessagePublicForwards#5630281b channel:InputChannel msg_id:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages; stats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats; -// LAYER 123 +// LAYER 124 diff --git a/Telegram/SourceFiles/api/api_invite_links.cpp b/Telegram/SourceFiles/api/api_invite_links.cpp index 34a79cc44..986ccaa08 100644 --- a/Telegram/SourceFiles/api/api_invite_links.cpp +++ b/Telegram/SourceFiles/api/api_invite_links.cpp @@ -92,19 +92,16 @@ void InviteLinks::performCreate( callbacks.push_back(std::move(done)); } - // #TODO links - //using Flag = MTPmessages_ExportChatInvite::Flag; - //_api->request(MTPmessages_ExportChatInvite( - // MTP_flags((revokeLegacyPermanent - // ? Flag::f_legacy_revoke_permanent - // : Flag(0)) - // | (expireDate ? Flag::f_expire_date : Flag(0)) - // | (usageLimit ? Flag::f_usage_limit : Flag(0))), - // peer->input, - // MTP_int(expireDate), - // MTP_int(usageLimit) + using Flag = MTPmessages_ExportChatInvite::Flag; _api->request(MTPmessages_ExportChatInvite( - peer->input + MTP_flags((revokeLegacyPermanent + ? Flag::f_legacy_revoke_permanent + : Flag(0)) + | (expireDate ? Flag::f_expire_date : Flag(0)) + | (usageLimit ? Flag::f_usage_limit : Flag(0))), + peer->input, + MTP_int(expireDate), + MTP_int(usageLimit) )).done([=](const MTPExportedChatInvite &result) { const auto callbacks = _createCallbacks.take(peer); const auto link = prepend(peer, result); diff --git a/Telegram/SourceFiles/api/api_sending.cpp b/Telegram/SourceFiles/api/api_sending.cpp index fea236ed2..076c6e43a 100644 --- a/Telegram/SourceFiles/api/api_sending.cpp +++ b/Telegram/SourceFiles/api/api_sending.cpp @@ -304,7 +304,8 @@ bool SendDice(Api::MessageToSend &message) { MTP_string(messagePostAuthor), MTPlong(), //MTPMessageReactions(), - MTPVector()), + MTPVector(), + MTPint()), // ttl_period clientFlags, NewMessageType::Unread); @@ -453,7 +454,8 @@ void SendConfirmedFile( MTP_string(messagePostAuthor), MTP_long(groupId), //MTPMessageReactions(), - MTPVector()); + MTPVector(), + MTPint()); // ttl_period if (itemToEdit) { itemToEdit->savePreviousMedia(); @@ -491,7 +493,8 @@ void SendConfirmedFile( MTP_string(messagePostAuthor), MTP_long(groupId), //MTPMessageReactions(), - MTPVector()); + MTPVector(), + MTPint()); // ttl_period if (itemToEdit) { itemToEdit->savePreviousMedia(); @@ -533,7 +536,8 @@ void SendConfirmedFile( MTP_string(messagePostAuthor), MTP_long(groupId), //MTPMessageReactions(), - MTPVector()), + MTPVector(), + MTPint()), // ttl_period clientFlags, NewMessageType::Unread); // Voices can't be edited. diff --git a/Telegram/SourceFiles/api/api_updates.cpp b/Telegram/SourceFiles/api/api_updates.cpp index 188e06a22..f7012632e 100644 --- a/Telegram/SourceFiles/api/api_updates.cpp +++ b/Telegram/SourceFiles/api/api_updates.cpp @@ -997,7 +997,8 @@ void Updates::applyUpdatesNoPtsCheck(const MTPUpdates &updates) { MTPstring(), MTPlong(), //MTPMessageReactions(), - MTPVector()), + MTPVector(), + MTP_int(d.vttl_period().value_or_empty())), MTPDmessage_ClientFlags(), NewMessageType::Unread); } break; @@ -1027,7 +1028,8 @@ void Updates::applyUpdatesNoPtsCheck(const MTPUpdates &updates) { MTPstring(), MTPlong(), //MTPMessageReactions(), - MTPVector()), + MTPVector(), + MTP_int(d.vttl_period().value_or_empty())), MTPDmessage_ClientFlags(), NewMessageType::Unread); } break; @@ -1825,6 +1827,11 @@ void Updates::feedUpdate(const MTPUpdate &update) { } } break; + case mtpc_updatePeerHistoryTTL: { + const auto &d = update.c_updatePeerHistoryTTL(); + // #TODO ttl + } break; + case mtpc_updateNewEncryptedMessage: { auto &d = update.c_updateNewEncryptedMessage(); } break; diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 6222b28bb..b5c9a7bc7 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -4129,7 +4129,8 @@ void ApiWrap::sendSharedContact( MTP_string(messagePostAuthor), MTPlong(), //MTPMessageReactions(), - MTPVector()), + MTPVector(), + MTPint()), // ttl_period clientFlags, NewMessageType::Unread); @@ -4407,7 +4408,8 @@ void ApiWrap::sendMessage(MessageToSend &&message) { MTP_string(messagePostAuthor), MTPlong(), //MTPMessageReactions(), - MTPVector()), + MTPVector(), + MTPint()), // ttl_period clientFlags, NewMessageType::Unread); histories.sendRequest(history, requestType, [=](Fn finish) { diff --git a/Telegram/SourceFiles/data/data_scheduled_messages.cpp b/Telegram/SourceFiles/data/data_scheduled_messages.cpp index f6bb51527..75ebf0027 100644 --- a/Telegram/SourceFiles/data/data_scheduled_messages.cpp +++ b/Telegram/SourceFiles/data/data_scheduled_messages.cpp @@ -72,7 +72,8 @@ MTPMessage PrepareMessage(const MTPMessage &message, MsgId id) { MTP_bytes(data.vpost_author().value_or_empty()), MTP_long(data.vgrouped_id().value_or_empty()), //MTPMessageReactions(), - MTPVector()); + MTPVector(), + MTP_int(data.vttl_period().value_or_empty())); }); } @@ -178,6 +179,9 @@ void ScheduledMessages::sendNowSimpleMessage( | MTPDmessage::Flag::f_from_id | (local->replyToId() ? MTPDmessage::Flag::f_reply_to + : MTPDmessage::Flag(0)) + | (update.vttl_period() + ? MTPDmessage::Flag::f_ttl_period : MTPDmessage::Flag(0)); auto clientFlags = NewMessageClientFlags() | MTPDmessage_ClientFlag::f_local_history_entry; @@ -206,7 +210,8 @@ void ScheduledMessages::sendNowSimpleMessage( MTP_string(), MTPlong(), //MTPMessageReactions(), - MTPVector()), + MTPVector(), + MTP_int(update.vttl_period().value_or_empty())), clientFlags, NewMessageType::Unread); diff --git a/Telegram/SourceFiles/data/data_session.cpp b/Telegram/SourceFiles/data/data_session.cpp index bcc4392b1..aa0a0e98e 100644 --- a/Telegram/SourceFiles/data/data_session.cpp +++ b/Telegram/SourceFiles/data/data_session.cpp @@ -4000,7 +4000,8 @@ void Session::insertCheckedServiceNotification( MTPstring(), MTPlong(), //MTPMessageReactions(), - MTPVector()), + MTPVector(), + MTPint()), // ttl_period clientFlags, NewMessageType::Unread); } diff --git a/Telegram/SourceFiles/export/data/export_data_types.cpp b/Telegram/SourceFiles/export/data/export_data_types.cpp index 52958126c..af4b0f6cf 100644 --- a/Telegram/SourceFiles/export/data/export_data_types.cpp +++ b/Telegram/SourceFiles/export/data/export_data_types.cpp @@ -643,9 +643,9 @@ std::pair WriteImageThumb( : largePath + postfix; const auto result = Output::File::PrepareRelativePath(basePath, thumb); if (!image.save( - basePath + result, - finalFormat.constData(), - finalQuality)) { + basePath + result, + finalFormat.constData(), + finalQuality)) { return {}; } return { result, finalSize }; diff --git a/Telegram/SourceFiles/export/output/export_output_html.cpp b/Telegram/SourceFiles/export/output/export_output_html.cpp index 3935bbdba..fe87118ba 100644 --- a/Telegram/SourceFiles/export/output/export_output_html.cpp +++ b/Telegram/SourceFiles/export/output/export_output_html.cpp @@ -966,7 +966,7 @@ auto HtmlWriter::Wrap::pushMessage( + SerializeString(data.title) + "»") : (serviceFrom - + " fchanged group title to «" + + " changed group title to «" + SerializeString(data.title) + "»"); }, [&](const ActionChatEditPhoto &data) { 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 cfac099bf..6c6f57517 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp @@ -86,7 +86,8 @@ MTPMessage PrepareLogMessage( | MTPDmessage::Flag::f_views | MTPDmessage::Flag::f_forwards //| MTPDmessage::Flag::f_reactions - | MTPDmessage::Flag::f_restriction_reason; + | MTPDmessage::Flag::f_restriction_reason + | MTPDmessage::Flag::f_ttl_period; return MTP_message( MTP_flags(data.vflags().v & ~removeFlags), MTP_int(newId), @@ -109,7 +110,8 @@ MTPMessage PrepareLogMessage( MTP_string(), MTP_long(0), // grouped_id //MTPMessageReactions(), - MTPVector()); + MTPVector(), + MTPint()); // ttl_period }); } @@ -968,6 +970,15 @@ void GenerateItems( createParticipantUnmute(data); }, [&](const MTPDchannelAdminLogEventActionToggleGroupCallSetting &data) { createToggleGroupCallSetting(data); + }, [&](const MTPDchannelAdminLogEventActionParticipantJoinByInvite &data) { + }, [&](const MTPDchannelAdminLogEventActionExportedInviteDelete &data) { + }, [&](const MTPDchannelAdminLogEventActionExportedInviteRevoke &data) { + }, [&](const MTPDchannelAdminLogEventActionExportedInviteEdit &data) { + // #TODO links + }, [&](const MTPDchannelAdminLogEventActionParticipantVolume &data) { + // #TODO calls + }, [&](const MTPDchannelAdminLogEventActionChangeHistoryTTL &data) { + // #TODO ttl }); } diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_send_data.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_send_data.cpp index fff7c4f13..2088615ee 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_send_data.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_bot_send_data.cpp @@ -73,7 +73,8 @@ void SendDataCommon::addToHistory( MTP_string(postAuthor), MTPlong(), //MTPMessageReactions(), - MTPVector()), + MTPVector(), + MTPint()), // ttl_period clientFlags, NewMessageType::Unread); } diff --git a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp index efb774bcf..f31e59a60 100644 --- a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp +++ b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp @@ -167,7 +167,8 @@ AdminLog::OwnedItem GenerateForwardedItem( MTPstring(), // post_author MTPlong(), // grouped_id //MTPMessageReactions(), - MTPVector() + MTPVector(), + MTPint() // ttl_period ).match([&](const MTPDmessage &data) { return history->makeMessage( data, diff --git a/Telegram/SourceFiles/support/support_autocomplete.cpp b/Telegram/SourceFiles/support/support_autocomplete.cpp index d7ceabdd9..d601e5611 100644 --- a/Telegram/SourceFiles/support/support_autocomplete.cpp +++ b/Telegram/SourceFiles/support/support_autocomplete.cpp @@ -322,7 +322,8 @@ AdminLog::OwnedItem GenerateContactItem( MTP_string(), MTP_long(0), //MTPMessageReactions(), - MTPVector()); + MTPVector(), + MTPint()); // ttl_period const auto item = history->makeMessage( message.c_message(), MTPDmessage_ClientFlag::f_fake_history_item);