diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 0037d48c76..4e8314d3e3 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -1523,6 +1523,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_action_attach_menu_bot_allowed" = "You allowed this bot to message you when you added it in the attachment menu."; "lng_action_set_wallpaper_me" = "You set a new background for this chat."; "lng_action_set_wallpaper" = "{user} set a new background for this chat."; +"lng_action_set_same_wallpaper_me" = "You set {background} for this chat."; +"lng_action_set_same_wallpaper" = "{user} set {background} for this chat."; +"lng_action_set_same_background" = "the same background"; "lng_action_topic_created_inside" = "Topic created"; "lng_action_topic_closed_inside" = "Topic closed"; "lng_action_topic_reopened_inside" = "Topic reopened"; @@ -3577,8 +3580,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_filters_link_private_status" = "you can't share private chats"; "lng_filters_link_private_error" = "Private chats can't be shared."; "lng_filters_link_noadmin_status" = "you can't invite others here"; -"lng_filters_link_noadmin_group_error" = "You don't have the admin rights to share invite links to this group chat."; -"lng_filters_link_noadmin_channel_error" = "You don't have the admin rights to share invite links to this channel."; +"lng_filters_link_noadmin_group_error" = "You don't have the admin rights to share invite links to this private group chat."; +"lng_filters_link_noadmin_channel_error" = "You don't have the admin rights to share invite links to this private channel."; "lng_filters_link_already_group" = "you are already a member"; "lng_filters_link_already_channel" = "you are already subscribed"; "lng_filters_link_chats_about" = "Select groups and channels that you want everyone who adds the folder via invite link to join."; @@ -3587,6 +3590,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_filters_link_chats_no_about" = "You can only share groups and channels in which you are allowed to create invite links."; "lng_filters_link_name_it" = "Name Link"; "lng_filters_link_delete_sure" = "Are you sure you want to delete this link?"; +"lng_filters_link_qr_about" = "Everyone on Telegram can scan this code to add this folder and join the chats included in this invite link."; "lng_filters_by_link_title" = "Add Folder"; "lng_filters_by_link_sure" = "Do you want to add a new chat folder {folder} and join its groups and channels?"; "lng_filters_by_link_join#one" = "{count} chat to join"; @@ -3603,7 +3607,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_filters_by_link_in#one" = "{count} chat in this folder"; "lng_filters_by_link_in#other" = "{count} chats in this folder"; "lng_filters_by_link_remove" = "Remove Folder"; -"lng_filters_by_link_remove_sure" = "Do you want to quit the chats you joined when added the folder {folder}?"; +"lng_filters_by_link_remove_sure" = "Do you also want to quit the chats included in the folder {folder}?"; "lng_filters_by_link_quit#one" = "{count} chat to quit"; "lng_filters_by_link_quit#other" = "{count} chats to quit"; "lng_filters_by_link_select" = "Select All"; @@ -3619,7 +3623,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_filters_updated_also#other" = "You have joined {count} new chats."; "lng_filters_bar_you_can#one" = "You can join {count} new chat"; "lng_filters_bar_you_can#other" = "You can join {count} new chats"; -"lng_filters_bar_view" = "Click here to view them"; +"lng_filters_bar_view#one" = "Click here to view it"; +"lng_filters_bar_view#other" = "Click here to view them"; "lng_chat_theme_change" = "Change colors"; "lng_chat_theme_none" = "No\nTheme"; diff --git a/Telegram/Resources/tl/api.tl b/Telegram/Resources/tl/api.tl index e0b47d9855..015391c6c4 100644 --- a/Telegram/Resources/tl/api.tl +++ b/Telegram/Resources/tl/api.tl @@ -197,6 +197,7 @@ messageActionTopicEdit#c0944820 flags:# title:flags.0?string icon_emoji_id:flags messageActionSuggestProfilePhoto#57de635e photo:Photo = MessageAction; messageActionRequestedPeer#fe77345d button_id:int peer:Peer = MessageAction; messageActionSetChatWallPaper#bc44a927 wallpaper:WallPaper = MessageAction; +messageActionSetSameChatWallPaper#da54583a = MessageAction; dialog#d58a08c6 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int 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; @@ -386,7 +387,7 @@ updateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector = Update; @@ -960,7 +961,7 @@ channelAdminLogEventActionDiscardGroupCall#db9f9140 call:InputGroupCall = Channe channelAdminLogEventActionParticipantMute#f92424d2 participant:GroupCallParticipant = ChannelAdminLogEventAction; channelAdminLogEventActionParticipantUnmute#e64429c0 participant:GroupCallParticipant = ChannelAdminLogEventAction; channelAdminLogEventActionToggleGroupCallSetting#56d6a247 join_muted:Bool = ChannelAdminLogEventAction; -channelAdminLogEventActionParticipantJoinByInvite#fe9fc158 flags:# via_community:flags.0?true invite:ExportedChatInvite = ChannelAdminLogEventAction; +channelAdminLogEventActionParticipantJoinByInvite#fe9fc158 flags:# via_chatlist:flags.0?true invite:ExportedChatInvite = ChannelAdminLogEventAction; channelAdminLogEventActionExportedInviteDelete#5a50fca4 invite:ExportedChatInvite = ChannelAdminLogEventAction; channelAdminLogEventActionExportedInviteRevoke#410a134e invite:ExportedChatInvite = ChannelAdminLogEventAction; channelAdminLogEventActionExportedInviteEdit#e90ebb59 prev_invite:ExportedChatInvite new_invite:ExportedChatInvite = ChannelAdminLogEventAction; @@ -1228,7 +1229,7 @@ payments.bankCardData#3e24e573 title:string open_urls:Vector = dialogFilter#7438f7e8 flags:# contacts:flags.0?true non_contacts:flags.1?true groups:flags.2?true broadcasts:flags.3?true bots:flags.4?true exclude_muted:flags.11?true exclude_read:flags.12?true exclude_archived:flags.13?true id:int title:string emoticon:flags.25?string pinned_peers:Vector include_peers:Vector exclude_peers:Vector = DialogFilter; dialogFilterDefault#363293ae = DialogFilter; -dialogFilterCommunity#d8565037 flags:# id:int title:string emoticon:flags.25?string pinned_peers:Vector include_peers:Vector = DialogFilter; +dialogFilterChatlist#d64a04a8 flags:# has_my_invites:flags.26?true id:int title:string emoticon:flags.25?string pinned_peers:Vector include_peers:Vector = DialogFilter; dialogFilterSuggested#77744d4a filter:DialogFilter description:string = DialogFilterSuggested; @@ -1307,7 +1308,7 @@ 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; -chatInviteImporter#8c5adfd9 flags:# requested:flags.0?true via_community:flags.3?true user_id:long date:int about:flags.2?string approved_by:flags.1?long = ChatInviteImporter; +chatInviteImporter#8c5adfd9 flags:# requested:flags.0?true via_chatlist:flags.3?true user_id:long date:int about:flags.2?string approved_by:flags.1?long = ChatInviteImporter; messages.exportedChatInvites#bdc62dcc count:int invites:Vector users:Vector = messages.ExportedChatInvites; @@ -1526,18 +1527,18 @@ inlineBotWebView#b57295d5 text:string url:string = InlineBotWebView; readParticipantDate#4a4ff172 user_id:long date:int = ReadParticipantDate; -inputCommunityDialogFilter#1ae107a1 filter_id:int = InputCommunity; +inputChatlistDialogFilter#f3e0da33 filter_id:int = InputChatlist; -exportedCommunityInvite#ebddc1aa flags:# title:string url:string peers:Vector = ExportedCommunityInvite; +exportedChatlistInvite#c5181ac flags:# title:string url:string peers:Vector = ExportedChatlistInvite; -communities.exportedCommunityInvite#6b97a8ea filter:DialogFilter invite:ExportedCommunityInvite = communities.ExportedCommunityInvite; +chatlists.exportedChatlistInvite#10e6e3a6 filter:DialogFilter invite:ExportedChatlistInvite = chatlists.ExportedChatlistInvite; -communities.exportedInvites#ffd75fa7 invites:Vector chats:Vector users:Vector = communities.ExportedInvites; +chatlists.exportedInvites#10ab6dc7 invites:Vector chats:Vector users:Vector = chatlists.ExportedInvites; -communities.communityInviteAlready#c745ee07 filter_id:int missing_peers:Vector already_peers:Vector chats:Vector users:Vector = communities.CommunityInvite; -communities.communityInvite#3857da1 flags:# title:string emoticon:flags.0?string peers:Vector chats:Vector users:Vector = communities.CommunityInvite; +chatlists.chatlistInviteAlready#fa87f659 filter_id:int missing_peers:Vector already_peers:Vector chats:Vector users:Vector = chatlists.ChatlistInvite; +chatlists.chatlistInvite#1dcd839d flags:# title:string emoticon:flags.0?string peers:Vector chats:Vector users:Vector = chatlists.ChatlistInvite; -communities.communityUpdates#e74660b3 missing_peers:Vector chats:Vector users:Vector = communities.CommunityUpdates; +chatlists.chatlistUpdates#93bd878d missing_peers:Vector chats:Vector users:Vector = chatlists.ChatlistUpdates; bots.botInfo#e8a775b0 name:string about:string description:string = bots.BotInfo; @@ -1623,7 +1624,7 @@ account.getContactSignUpNotification#9f07c728 = Bool; account.setContactSignUpNotification#cff43f61 silent:Bool = Bool; account.getNotifyExceptions#53577479 flags:# compare_sound:flags.1?true peer:flags.0?InputNotifyPeer = Updates; account.getWallPaper#fc8ddbea wallpaper:InputWallPaper = WallPaper; -account.uploadWallPaper#dd853661 file:InputFile mime_type:string settings:WallPaperSettings = WallPaper; +account.uploadWallPaper#e39a8f03 flags:# for_chat:flags.0?true file:InputFile mime_type:string settings:WallPaperSettings = WallPaper; account.saveWallPaper#6c5a5b37 wallpaper:InputWallPaper unsave:Bool settings:WallPaperSettings = Bool; account.installWallPaper#feed5769 wallpaper:InputWallPaper settings:WallPaperSettings = Bool; account.resetWallPapers#bb3b9804 = Bool; @@ -1877,7 +1878,7 @@ messages.searchCustomEmoji#2c11c0d7 emoticon:string hash:long = EmojiList; messages.togglePeerTranslations#e47cb579 flags:# disabled:flags.0?true peer:InputPeer = Bool; messages.getBotApp#34fdc5c3 app:InputBotApp hash:long = messages.BotApp; messages.requestAppWebView#8c5a3b3c flags:# write_allowed:flags.0?true peer:InputPeer app:InputBotApp start_param:flags.1?string theme_params:flags.2?DataJSON platform:string = AppWebViewResult; -messages.setChatWallPaper#bddd7eaa peer:InputPeer wallpaper:InputWallPaper settings:WallPaperSettings = Updates; +messages.setChatWallPaper#dbaaba25 flags:# peer:InputPeer wallpaper:flags.0?InputWallPaper settings:flags.0?WallPaperSettings id:flags.1?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; @@ -2061,16 +2062,16 @@ 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; -communities.exportCommunityInvite#41fe69d9 community:InputCommunity title:string peers:Vector = communities.ExportedCommunityInvite; -communities.deleteExportedInvite#f96e4616 community:InputCommunity slug:string = Bool; -communities.editExportedInvite#27140512 flags:# community:InputCommunity slug:string title:flags.1?string peers:flags.2?Vector = ExportedCommunityInvite; -communities.getExportedInvites#4688a39d community:InputCommunity = communities.ExportedInvites; -communities.checkCommunityInvite#99ba9e5 slug:string = communities.CommunityInvite; -communities.joinCommunityInvite#4eff927 slug:string peers:Vector = Updates; -communities.getCommunityUpdates#2956d635 community:InputCommunity = communities.CommunityUpdates; -communities.joinCommunityUpdates#51d42216 community:InputCommunity peers:Vector = Updates; -communities.hideCommunityUpdates#d678baf community:InputCommunity = Bool; -communities.getLeaveCommunitySuggestions#ee4e9ae2 community:InputCommunity = Vector; -communities.leaveCommunity#35d9755f community:InputCommunity peers:Vector = Updates; +chatlists.exportChatlistInvite#8472478e chatlist:InputChatlist title:string peers:Vector = chatlists.ExportedChatlistInvite; +chatlists.deleteExportedInvite#719c5c5e chatlist:InputChatlist slug:string = Bool; +chatlists.editExportedInvite#653db63d flags:# chatlist:InputChatlist slug:string title:flags.1?string peers:flags.2?Vector = ExportedChatlistInvite; +chatlists.getExportedInvites#ce03da83 chatlist:InputChatlist = chatlists.ExportedInvites; +chatlists.checkChatlistInvite#41c10fff slug:string = chatlists.ChatlistInvite; +chatlists.joinChatlistInvite#a6b1e39a slug:string peers:Vector = Updates; +chatlists.getChatlistUpdates#89419521 chatlist:InputChatlist = chatlists.ChatlistUpdates; +chatlists.joinChatlistUpdates#e089f8f5 chatlist:InputChatlist peers:Vector = Updates; +chatlists.hideChatlistUpdates#66e486fb chatlist:InputChatlist = Bool; +chatlists.getLeaveChatlistSuggestions#fdbcd714 chatlist:InputChatlist = Vector; +chatlists.leaveChatlist#74fae13a chatlist:InputChatlist peers:Vector = Updates; // LAYER 158 diff --git a/Telegram/SourceFiles/api/api_chat_filters.cpp b/Telegram/SourceFiles/api/api_chat_filters.cpp index 332afd22f1..7908ddc404 100644 --- a/Telegram/SourceFiles/api/api_chat_filters.cpp +++ b/Telegram/SourceFiles/api/api_chat_filters.cpp @@ -216,7 +216,7 @@ void ImportInvite( auto inputs = peers | ranges::views::transform([](auto peer) { return MTPInputPeer(peer->input); }) | ranges::to(); - api->request(MTPcommunities_JoinCommunityInvite( + api->request(MTPchatlists_JoinChatlistInvite( MTP_string(slug), MTP_vector(std::move(inputs)) )).done(callback).fail(error).send(); @@ -527,7 +527,7 @@ void CheckFilterInvite( const auto session = &controller->session(); const auto weak = base::make_weak(controller); session->api().checkFilterInvite(slug, [=]( - const MTPcommunities_CommunityInvite &result) { + const MTPchatlists_ChatlistInvite &result) { const auto strong = weak.get(); if (!strong) { return; @@ -550,11 +550,11 @@ void CheckFilterInvite( } return result; }; - result.match([&](const MTPDcommunities_communityInvite &data) { + result.match([&](const MTPDchatlists_chatlistInvite &data) { title = qs(data.vtitle()); iconEmoji = data.vemoticon().value_or_empty(); peers = parseList(data.vpeers()); - }, [&](const MTPDcommunities_communityInviteAlready &data) { + }, [&](const MTPDchatlists_chatlistInviteAlready &data) { filterId = data.vfilter_id().v; peers = parseList(data.vmissing_peers()); already = parseList(data.valready_peers()); diff --git a/Telegram/SourceFiles/api/api_invite_links.cpp b/Telegram/SourceFiles/api/api_invite_links.cpp index 8958285f7d..1f02b78c13 100644 --- a/Telegram/SourceFiles/api/api_invite_links.cpp +++ b/Telegram/SourceFiles/api/api_invite_links.cpp @@ -58,7 +58,7 @@ JoinedByLinkSlice ParseJoinedByLinkSlice( result.users.push_back({ .user = owner.user(data.vuser_id()), .date = data.vdate().v, - .viaFilterLink = data.is_via_community(), + .viaFilterLink = data.is_via_chatlist(), }); }); } diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index f7a097d263..a589be4928 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -382,11 +382,11 @@ void ApiWrap::checkChatInvite( void ApiWrap::checkFilterInvite( const QString &slug, - FnMut done, + FnMut done, Fn fail) { request(base::take(_checkFilterInviteRequestId)).cancel(); _checkFilterInviteRequestId = request( - MTPcommunities_CheckCommunityInvite(MTP_string(slug)) + MTPchatlists_CheckChatlistInvite(MTP_string(slug)) ).done(std::move(done)).fail(std::move(fail)).send(); } diff --git a/Telegram/SourceFiles/apiwrap.h b/Telegram/SourceFiles/apiwrap.h index a142e09a91..e747f0f072 100644 --- a/Telegram/SourceFiles/apiwrap.h +++ b/Telegram/SourceFiles/apiwrap.h @@ -204,7 +204,7 @@ public: Fn fail); void checkFilterInvite( const QString &slug, - FnMut done, + FnMut done, Fn fail); void processFullPeer( diff --git a/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp b/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp index 6bbded27cf..ba170509b1 100644 --- a/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp +++ b/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp @@ -554,19 +554,19 @@ void EditFilterBox( rpl::variable rules; rpl::variable> links; rpl::variable hasLinks; - rpl::variable community; + rpl::variable chatlist; }; const auto owner = &window->session().data(); const auto state = box->lifetime().make_state(State{ .rules = filter, - .community = filter.community(), + .chatlist = filter.chatlist(), }); - state->links = owner->chatsFilters().communityLinks(filter.id()), + state->links = owner->chatsFilters().chatlistLinks(filter.id()), state->hasLinks = state->links.value() | rpl::map([=](const auto &v) { return !v.empty(); }); - if (!state->community.current()) { - state->community = state->hasLinks.value() | rpl::filter( + if (!state->chatlist.current()) { + state->chatlist = state->hasLinks.value() | rpl::filter( _1 ) | rpl::take(1); } @@ -657,7 +657,7 @@ void EditFilterBox( content, object_ptr(content)) )->setDuration(0); - excludeWrap->toggleOn(state->community.value() | rpl::map(!_1)); + excludeWrap->toggleOn(state->chatlist.value() | rpl::map(!_1)); const auto excludeInner = excludeWrap->entity(); AddSubsectionTitle(excludeInner, tr::lng_filters_exclude()); @@ -717,8 +717,8 @@ void EditFilterBox( content->resizeToWidth(content->widthNoMargins()); }, content->lifetime()); - if (filter.community()) { - window->session().data().chatsFilters().reloadCommunityLinks( + if (filter.chatlist()) { + window->session().data().chatsFilters().reloadChatlistLinks( filter.id()); } @@ -763,13 +763,13 @@ void EditFilterBox( // Comparison of ChatFilter-s don't take id into account! data->force_assign(updated); const auto id = updated.id(); - state->links = owner->chatsFilters().communityLinks(id); + state->links = owner->chatsFilters().chatlistLinks(id); ExportFilterLink(id, shared, [=](Data::ChatFilterLink link) { Expects(link.id == id); window->show(ShowLinkBox(window, updated, link)); }, [=](QString error) { - if (error == "COMMUNITIES_TOO_MUCH") { + if (error == "CHATLISTS_TOO_MUCH") { // #TODO filters } else { window->show(ShowLinkBox(window, updated, { .id = id })); @@ -799,7 +799,7 @@ void EditFilterBox( EditExceptions( window, box, - kTypes | (state->community.current() ? Flag::Community : Flag()), + kTypes | (state->chatlist.current() ? Flag::Chatlist : Flag()), data, updateDefaultTitle, refreshPreviews); diff --git a/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.cpp b/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.cpp index ae50f0bccf..8e393c5832 100644 --- a/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.cpp +++ b/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.cpp @@ -343,10 +343,10 @@ EditFilterChatsListController::EditFilterChatsListController( , _session(session) , _title(std::move(title)) , _peers(peers) -, _options(options & ~Flag::Community) +, _options(options & ~Flag::Chatlist) , _selected(selected) , _limit(Limit(session)) -, _community(options & Flag::Community) { +, _chatlist(options & Flag::Chatlist) { } Main::Session &EditFilterChatsListController::session() const { @@ -354,9 +354,9 @@ Main::Session &EditFilterChatsListController::session() const { } int EditFilterChatsListController::selectedTypesCount() const { - Expects(_community || _typesDelegate != nullptr); + Expects(_chatlist || _typesDelegate != nullptr); - if (_community) { + if (_chatlist) { return 0; } auto result = 0; @@ -400,7 +400,7 @@ bool EditFilterChatsListController::handleDeselectForeignRow( void EditFilterChatsListController::prepareViewHook() { delegate()->peerListSetTitle(std::move(_title)); - if (!_community) { + if (!_chatlist) { delegate()->peerListSetAboveWidget(prepareTypesList()); } diff --git a/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.h b/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.h index b752fb7397..ce45831843 100644 --- a/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.h +++ b/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.h @@ -75,7 +75,7 @@ private: Flags _options; Flags _selected; int _limit = 0; - bool _community = false; + bool _chatlist = false; Fn _deselectOption; diff --git a/Telegram/SourceFiles/boxes/filters/edit_filter_links.cpp b/Telegram/SourceFiles/boxes/filters/edit_filter_links.cpp index 0aee58f6dd..cd3df07825 100644 --- a/Telegram/SourceFiles/boxes/filters/edit_filter_links.cpp +++ b/Telegram/SourceFiles/boxes/filters/edit_filter_links.cpp @@ -606,7 +606,7 @@ void LinkController::addLinkBlock(not_null container) { }); const auto getLinkQr = crl::guard(weak, [=] { delegate()->peerListShowBox( - InviteLinkQrBox(link), + InviteLinkQrBox(link, tr::lng_filters_link_qr_about()), Ui::LayerOption::KeepOther); }); const auto editLink = crl::guard(weak, [=] { @@ -885,7 +885,7 @@ base::unique_qptr LinksController::createRowContextMenu( }; const auto getLinkQr = [=] { delegate()->peerListShowBox( - InviteLinkQrBox(link), + InviteLinkQrBox(link, tr::lng_filters_link_qr_about()), Ui::LayerOption::KeepOther); }; const auto editLink = [=] { @@ -1040,7 +1040,7 @@ bool GoodForExportFilterLink( not_null window, const Data::ChatFilter &filter) { using Flag = Data::ChatFilter::Flag; - if (!filter.never().empty() || (filter.flags() & ~Flag::Community)) { + if (!filter.never().empty() || (filter.flags() & ~Flag::Chatlist)) { Ui::ShowMultilineToast({ .parentOverride = Window::Show(window).toastParent(), .text = { tr::lng_filters_link_cant(tr::now) }, @@ -1062,11 +1062,11 @@ void ExportFilterLink( auto mtpPeers = peers | ranges::views::transform( [](not_null peer) { return MTPInputPeer(peer->input); } ) | ranges::to(); - session->api().request(MTPcommunities_ExportCommunityInvite( - MTP_inputCommunityDialogFilter(MTP_int(id)), + session->api().request(MTPchatlists_ExportChatlistInvite( + MTP_inputChatlistDialogFilter(MTP_int(id)), MTP_string(), // title MTP_vector(std::move(mtpPeers)) - )).done([=](const MTPcommunities_ExportedCommunityInvite &result) { + )).done([=](const MTPchatlists_ExportedChatlistInvite &result) { const auto &data = result.data(); session->data().chatsFilters().apply(MTP_updateDialogFilter( MTP_flags(MTPDupdateDialogFilter::Flag::f_filter), @@ -1094,13 +1094,13 @@ void EditLinkChats( auto mtpPeers = peers | ranges::views::transform( [](not_null peer) { return MTPInputPeer(peer->input); } ) | ranges::to(); - session->api().request(MTPcommunities_EditExportedInvite( - MTP_flags(MTPcommunities_EditExportedInvite::Flag::f_peers), - MTP_inputCommunityDialogFilter(MTP_int(link.id)), + session->api().request(MTPchatlists_EditExportedInvite( + MTP_flags(MTPchatlists_EditExportedInvite::Flag::f_peers), + MTP_inputChatlistDialogFilter(MTP_int(link.id)), MTP_string(link.url), MTPstring(), // title MTP_vector(std::move(mtpPeers)) - )).done([=](const MTPExportedCommunityInvite &result) { + )).done([=](const MTPExportedChatlistInvite &result) { const auto &data = result.data(); const auto link = session->data().chatsFilters().add(id, result); //done(link); diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.cpp index 681ce1f647..0d38443627 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.cpp @@ -274,6 +274,7 @@ QImage QrForShare(const QString &text) { void QrBox( not_null box, const QString &link, + rpl::producer about, Fn)> share) { box->setTitle(tr::lng_group_invite_qr_title()); @@ -307,7 +308,7 @@ void QrBox( box->addRow( object_ptr( box, - tr::lng_group_invite_qr_about(), + std::move(about), st::boxLabel), st::inviteLinkQrValuePadding); @@ -354,7 +355,7 @@ void Controller::addHeaderBlock(not_null container) { }); const auto getLinkQr = crl::guard(weak, [=] { delegate()->peerListShowBox( - InviteLinkQrBox(link), + InviteLinkQrBox(link, tr::lng_group_invite_qr_about()), Ui::LayerOption::KeepOther); }); const auto revokeLink = crl::guard(weak, [=] { @@ -973,7 +974,9 @@ void AddPermanentLinkBlock( const auto getLinkQr = crl::guard(weak, [=] { if (const auto current = value->current(); !current.link.isEmpty()) { show->showBox( - InviteLinkQrBox(current.link), + InviteLinkQrBox( + current.link, + tr::lng_group_invite_qr_about()), Ui::LayerOption::KeepOther); } }); @@ -1224,8 +1227,10 @@ object_ptr ShareInviteLinkBox( return object; } -object_ptr InviteLinkQrBox(const QString &link) { - return Box(QrBox, link, [=]( +object_ptr InviteLinkQrBox( + const QString &link, + rpl::producer about) { + return Box(QrBox, link, std::move(about), [=]( const QImage &image, std::shared_ptr show) { auto mime = std::make_unique(); diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.h b/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.h index 7fc9c2d535..40654776e0 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.h +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.h @@ -45,7 +45,9 @@ void CopyInviteLink(not_null toastParent, const QString &link); [[nodiscard]] object_ptr ShareInviteLinkBox( not_null session, const QString &link); -[[nodiscard]] object_ptr InviteLinkQrBox(const QString &link); +[[nodiscard]] object_ptr InviteLinkQrBox( + const QString &link, + rpl::producer about); [[nodiscard]] object_ptr RevokeLinkBox( not_null peer, not_null admin, diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_invite_links.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_invite_links.cpp index 1be67226d6..82a46aff61 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_invite_links.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_invite_links.cpp @@ -594,7 +594,7 @@ base::unique_qptr LinksController::createRowContextMenu( }, &st::menuIconShare); result->addAction(tr::lng_group_invite_context_qr(tr::now), [=] { delegate()->peerListShowBox( - InviteLinkQrBox(link), + InviteLinkQrBox(link, tr::lng_group_invite_qr_about()), Ui::LayerOption::KeepOther); }, &st::menuIconQrCode); result->addAction(tr::lng_group_invite_context_edit(tr::now), [=] { diff --git a/Telegram/SourceFiles/data/data_chat_filters.cpp b/Telegram/SourceFiles/data/data_chat_filters.cpp index 8cf286943d..e70665205d 100644 --- a/Telegram/SourceFiles/data/data_chat_filters.cpp +++ b/Telegram/SourceFiles/data/data_chat_filters.cpp @@ -109,7 +109,7 @@ ChatFilter ChatFilter::FromTL( { never.begin(), never.end() }); }, [](const MTPDdialogFilterDefault &d) { return ChatFilter(); - }, [&](const MTPDdialogFilterCommunity &data) { + }, [&](const MTPDdialogFilterChatlist &data) { auto &&to_histories = ranges::views::transform([&]( const MTPInputPeer &data) { const auto peer = data.match([&](const MTPDinputPeerUser &data) { @@ -148,7 +148,7 @@ ChatFilter ChatFilter::FromTL( data.vid().v, qs(data.vtitle()), qs(data.vemoticon().value_or_empty()), - Flag::Community, + Flag::Chatlist, std::move(list), std::move(pinned), {}); @@ -174,10 +174,10 @@ MTPDialogFilter ChatFilter::tl(FilterId replaceId) const { for (const auto &history : always) { include.push_back(history->peer->input); } - if (_flags & Flag::Community) { - using TLFlag = MTPDdialogFilterCommunity::Flag; + if (_flags & Flag::Chatlist) { + using TLFlag = MTPDdialogFilterChatlist::Flag; const auto flags = TLFlag::f_emoticon; - return MTP_dialogFilterCommunity( + return MTP_dialogFilterChatlist( MTP_flags(flags), MTP_int(replaceId ? replaceId : _id), MTP_string(_title), @@ -228,8 +228,8 @@ ChatFilter::Flags ChatFilter::flags() const { return _flags; } -bool ChatFilter::community() const { - return _flags & Flag::Community; +bool ChatFilter::chatlist() const { + return _flags & Flag::Chatlist; } const base::flat_set> &ChatFilter::always() const { @@ -410,15 +410,15 @@ void ChatFilters::apply(const MTPUpdate &update) { ChatFilterLink ChatFilters::add( FilterId id, - const MTPExportedCommunityInvite &update) { + const MTPExportedChatlistInvite &update) { const auto i = ranges::find(_list, id, &ChatFilter::id); - if (i == end(_list) || !i->community()) { + if (i == end(_list) || !i->chatlist()) { LOG(("Api Error: " - "Attempt to add community link to a non-community filter: %1" + "Attempt to add chatlist link to a non-chatlist filter: %1" ).arg(id)); return {}; } - auto &links = _communityLinks[id]; + auto &links = _chatlistLinks[id]; const auto &data = update.data(); const auto url = qs(data.vurl()); const auto title = qs(data.vtitle()); @@ -431,7 +431,7 @@ ChatFilterLink ChatFilters::add( if (j->title != title || j->chats != chats) { j->title = title; j->chats = std::move(chats); - _communityLinksUpdated.fire_copy(id); + _chatlistLinksUpdated.fire_copy(id); } return *j; } @@ -441,7 +441,7 @@ ChatFilterLink ChatFilters::add( .title = title, .chats = std::move(chats), }); - _communityLinksUpdated.fire_copy(id); + _chatlistLinksUpdated.fire_copy(id); return links.back(); } @@ -449,19 +449,19 @@ void ChatFilters::edit( FilterId id, const QString &url, const QString &title) { - auto &links = _communityLinks[id]; + auto &links = _chatlistLinks[id]; const auto i = ranges::find(links, url, &ChatFilterLink::url); if (i != end(links)) { i->title = title; - _communityLinksUpdated.fire_copy(id); + _chatlistLinksUpdated.fire_copy(id); - _owner->session().api().request(MTPcommunities_EditExportedInvite( - MTP_flags(MTPcommunities_EditExportedInvite::Flag::f_title), - MTP_inputCommunityDialogFilter(MTP_int(id)), + _owner->session().api().request(MTPchatlists_EditExportedInvite( + MTP_flags(MTPchatlists_EditExportedInvite::Flag::f_title), + MTP_inputChatlistDialogFilter(MTP_int(id)), MTP_string(url), MTP_string(title), MTPVector() // peers - )).done([=](const MTPExportedCommunityInvite &result) { + )).done([=](const MTPExportedChatlistInvite &result) { //const auto &data = result.data(); //const auto link = _owner->chatsFilters().add(id, result); //done(link); @@ -472,47 +472,47 @@ void ChatFilters::edit( } void ChatFilters::destroy(FilterId id, const QString &url) { - auto &links = _communityLinks[id]; + auto &links = _chatlistLinks[id]; const auto i = ranges::find(links, url, &ChatFilterLink::url); if (i != end(links)) { links.erase(i); - _communityLinksUpdated.fire_copy(id); + _chatlistLinksUpdated.fire_copy(id); const auto api = &_owner->session().api(); api->request(_linksRequestId).cancel(); - _linksRequestId = api->request(MTPcommunities_DeleteExportedInvite( - MTP_inputCommunityDialogFilter(MTP_int(id)), + _linksRequestId = api->request(MTPchatlists_DeleteExportedInvite( + MTP_inputChatlistDialogFilter(MTP_int(id)), MTP_string(url) )).send(); } } -rpl::producer> ChatFilters::communityLinks( +rpl::producer> ChatFilters::chatlistLinks( FilterId id) const { - return _communityLinksUpdated.events_starting_with_copy( + return _chatlistLinksUpdated.events_starting_with_copy( id ) | rpl::filter(rpl::mappers::_1 == id) | rpl::map([=] { - const auto i = _communityLinks.find(id); - return (i != end(_communityLinks)) + const auto i = _chatlistLinks.find(id); + return (i != end(_chatlistLinks)) ? i->second : std::vector(); }); } -void ChatFilters::reloadCommunityLinks(FilterId id) { +void ChatFilters::reloadChatlistLinks(FilterId id) { const auto api = &_owner->session().api(); api->request(_linksRequestId).cancel(); - _linksRequestId = api->request(MTPcommunities_GetExportedInvites( - MTP_inputCommunityDialogFilter(MTP_int(id)) - )).done([=](const MTPcommunities_ExportedInvites &result) { + _linksRequestId = api->request(MTPchatlists_GetExportedInvites( + MTP_inputChatlistDialogFilter(MTP_int(id)) + )).done([=](const MTPchatlists_ExportedInvites &result) { const auto &data = result.data(); _owner->processUsers(data.vusers()); _owner->processChats(data.vchats()); - _communityLinks[id].clear(); + _chatlistLinks[id].clear(); for (const auto &link : data.vinvites().v) { add(id, link); } - _communityLinksUpdated.fire_copy(id); + _chatlistLinksUpdated.fire_copy(id); }).send(); } diff --git a/Telegram/SourceFiles/data/data_chat_filters.h b/Telegram/SourceFiles/data/data_chat_filters.h index 83875fd43a..f07ec5a1b1 100644 --- a/Telegram/SourceFiles/data/data_chat_filters.h +++ b/Telegram/SourceFiles/data/data_chat_filters.h @@ -32,7 +32,7 @@ public: NoRead = (1 << 6), NoArchived = (1 << 7), - Community = (1 << 8), + Chatlist = (1 << 8), }; friend constexpr inline bool is_flag_type(Flag) { return true; }; using Flags = base::flags; @@ -58,7 +58,7 @@ public: [[nodiscard]] QString title() const; [[nodiscard]] QString iconEmoji() const; [[nodiscard]] Flags flags() const; - [[nodiscard]] bool community() const; + [[nodiscard]] bool chatlist() const; [[nodiscard]] const base::flat_set> &always() const; [[nodiscard]] const std::vector> &pinned() const; [[nodiscard]] const base::flat_set> &never() const; @@ -149,15 +149,15 @@ public: ChatFilterLink add( FilterId id, - const MTPExportedCommunityInvite &update); + const MTPExportedChatlistInvite &update); void edit( FilterId id, const QString &url, const QString &title); void destroy(FilterId id, const QString &url); - rpl::producer> communityLinks( + rpl::producer> chatlistLinks( FilterId id) const; - void reloadCommunityLinks(FilterId id); + void reloadChatlistLinks(FilterId id); private: void load(bool force); @@ -186,8 +186,8 @@ private: std::deque _exceptionsToLoad; mtpRequestId _exceptionsLoadRequestId = 0; - base::flat_map> _communityLinks; - rpl::event_stream _communityLinksUpdated; + base::flat_map> _chatlistLinks; + rpl::event_stream _chatlistLinksUpdated; mtpRequestId _linksRequestId = 0; }; diff --git a/Telegram/SourceFiles/export/data/export_data_types.cpp b/Telegram/SourceFiles/export/data/export_data_types.cpp index 34d4d3897d..b0bd242681 100644 --- a/Telegram/SourceFiles/export/data/export_data_types.cpp +++ b/Telegram/SourceFiles/export/data/export_data_types.cpp @@ -1186,6 +1186,8 @@ ServiceAction ParseServiceAction( auto content = ActionSetChatWallPaper(); // #TODO wallpapers result.content = content; + }, [&](const MTPDmessageActionSetSameChatWallPaper &data) { + result.content = ActionSetSameChatWallPaper(); }, [&](const MTPDmessageActionRequestedPeer &data) { auto content = ActionRequestedPeer(); content.peerId = ParsePeerId(data.vpeer()); diff --git a/Telegram/SourceFiles/export/data/export_data_types.h b/Telegram/SourceFiles/export/data/export_data_types.h index fa472850b4..d383fdb940 100644 --- a/Telegram/SourceFiles/export/data/export_data_types.h +++ b/Telegram/SourceFiles/export/data/export_data_types.h @@ -519,6 +519,9 @@ struct ActionSetChatWallPaper { // #TODO wallpapers }; +struct ActionSetSameChatWallPaper { +}; + struct ActionRequestedPeer { PeerId peerId = 0; int buttonId = 0; @@ -561,7 +564,8 @@ struct ServiceAction { ActionTopicEdit, ActionSuggestProfilePhoto, ActionRequestedPeer, - ActionSetChatWallPaper> content; + ActionSetChatWallPaper, + ActionSetSameChatWallPaper> content; }; ServiceAction ParseServiceAction( diff --git a/Telegram/SourceFiles/export/output/export_output_html.cpp b/Telegram/SourceFiles/export/output/export_output_html.cpp index 53f78c7041..00c4155ad4 100644 --- a/Telegram/SourceFiles/export/output/export_output_html.cpp +++ b/Telegram/SourceFiles/export/output/export_output_html.cpp @@ -1175,6 +1175,11 @@ auto HtmlWriter::Wrap::pushMessage( return "requested: "_q/* + data.peerId*/; }, [&](const ActionSetChatWallPaper &data) { return serviceFrom + " set a new background for this chat"; + }, [&](const ActionSetSameChatWallPaper &data) { + return serviceFrom + + " set " + + wrapReplyToLink("the same background") + + " for this chat"; }, [](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 142addf97b..1c6ba2c877 100644 --- a/Telegram/SourceFiles/export/output/export_output_json.cpp +++ b/Telegram/SourceFiles/export/output/export_output_json.cpp @@ -593,6 +593,10 @@ QByteArray SerializeMessage( }, [&](const ActionSetChatWallPaper &data) { pushActor(); pushAction("set_chat_wallpaper"); + }, [&](const ActionSetSameChatWallPaper &data) { + pushActor(); + pushAction("set_same_chat_wallpaper"); + pushReplyToMsgId("message_id"); }, [](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 3cb49004c4..3379417d5f 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp @@ -1392,7 +1392,7 @@ void GenerateItems( const auto createParticipantJoinByInvite = [&]( const LogJoinByInvite &data) { - const auto text = data.is_via_community() + const auto text = data.is_via_chatlist() ? (channel->isMegagroup() ? tr::lng_admin_log_participant_joined_by_filter_link : tr::lng_admin_log_participant_joined_by_filter_link_channel) diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index d92f088d76..2ab72b0194 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -672,6 +672,8 @@ HistoryServiceDependentData *HistoryItem::GetServiceDependentData() { return payment; } else if (const auto info = Get()) { return info; + } else if (const auto same = Get()) { + return same; } return nullptr; } @@ -3426,6 +3428,8 @@ void HistoryItem::createServiceFromMtp(const MTPDmessageService &message) { } }, call->lifetime); } + } else if (type == mtpc_messageActionSetSameChatWallPaper) { + UpdateComponents(HistoryServiceSameBackground::Bit()); } if (const auto replyTo = message.vreply_to()) { replyTo->match([&](const MTPDmessageReplyHeader &data) { @@ -4177,6 +4181,37 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) { return result; }; + auto prepareSetSameChatWallPaper = [&]( + const MTPDmessageActionSetSameChatWallPaper &action) { + const auto isSelf = (_from->id == _from->session().userPeerId()); + const auto peer = isSelf ? history()->peer : _from; + const auto user = peer->asUser(); + const auto name = (user && !user->firstName.isEmpty()) + ? user->firstName + : peer->name(); + auto result = PreparedServiceText{}; + if (!isSelf) { + result.links.push_back(peer->createOpenLink()); + } + if (const auto dependent = GetServiceDependentData()) { + result.links.push_back(dependent->lnk); + } + result.text = isSelf + ? tr::lng_action_set_same_wallpaper( + tr::now, + lt_user, + Ui::Text::Link(name, 1), // Link 1. + lt_background, + Ui::Text::Link(tr::lng_action_set_same_background(tr::now), 2), + Ui::Text::WithEntities) + : tr::lng_action_set_same_wallpaper_me( + tr::now, + lt_background, + Ui::Text::Link(tr::lng_action_set_same_background(tr::now), 1), + Ui::Text::WithEntities); + return result; + }; + setServiceText(action.match([&]( const MTPDmessageActionChatAddUser &data) { return prepareChatAddUserText(data); @@ -4255,6 +4290,8 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) { return prepareRequestedPeer(data); }, [&](const MTPDmessageActionSetChatWallPaper &data) { return prepareSetChatWallPaper(data); + }, [&](const MTPDmessageActionSetSameChatWallPaper &data) { + return prepareSetSameChatWallPaper(data); }, [](const MTPDmessageActionEmpty &) { return PreparedServiceText{ { tr::lng_message_empty(tr::now) } }; })); diff --git a/Telegram/SourceFiles/history/history_item_components.h b/Telegram/SourceFiles/history/history_item_components.h index 5fc0e6e1c1..5b92c6cfc1 100644 --- a/Telegram/SourceFiles/history/history_item_components.h +++ b/Telegram/SourceFiles/history/history_item_components.h @@ -530,6 +530,11 @@ struct HistoryServicePayment bool recurringUsed = false; }; +struct HistoryServiceSameBackground +: public RuntimeComponent +, public HistoryServiceDependentData { +}; + enum class HistorySelfDestructType { Photo, Video, diff --git a/Telegram/SourceFiles/settings/settings_folders.cpp b/Telegram/SourceFiles/settings/settings_folders.cpp index 479883322f..6b2c3aea02 100644 --- a/Telegram/SourceFiles/settings/settings_folders.cpp +++ b/Telegram/SourceFiles/settings/settings_folders.cpp @@ -159,7 +159,7 @@ struct FilterRow { const auto result = count ? tr::lng_filters_chats_count(tr::now, lt_count_short, count) : tr::lng_filters_no_chats(tr::now); - return filter.community() + return filter.chatlist() ? result + QString::fromUtf8(" \xE2\x80\xA2 shareable folder") : result; } @@ -371,7 +371,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) { const auto row = find(button); if (row->removed || row->removePeersRequestId > 0) { return; - } else if (row->filter.community() + } else if (row->filter.chatlist() && !row->filter.always().empty()) { const auto chosen = crl::guard(button, [=]( std::vector> peers) { @@ -399,7 +399,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) { const auto row = find(button); if (row->removed || row->removePeersRequestId > 0) { return; - } else if (row->filter.community() && row->removeHasLinks) { + } else if (row->filter.chatlist() && row->removeHasLinks) { controller->show(Ui::MakeConfirmBox({ .text = { tr::lng_filters_delete_sure(tr::now) }, .confirmed = crl::guard(button, [=](Fn close) { @@ -417,10 +417,10 @@ void FilterRowButton::paintEvent(QPaintEvent *e) { const auto row = find(button); if (row->removed || row->removePeersRequestId > 0) { return; - } else if (row->filter.community() && !row->removePeersRequestId) { + } else if (row->filter.chatlist() && !row->removePeersRequestId) { row->removePeersRequestId = session->api().request( - MTPcommunities_GetLeaveCommunitySuggestions( - MTP_inputCommunityDialogFilter( + MTPchatlists_GetLeaveChatlistSuggestions( + MTP_inputChatlistDialogFilter( MTP_int(row->filter.id()))) ).done(crl::guard(button, [=](const MTPVector &result) { const auto row = find(button); @@ -642,7 +642,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) { auto updates = std::vector(); auto addRequests = std::vector(); auto removeRequests = std::vector(); - auto removeCommunityRequests = std::vector(); + auto removeChatlistRequests = std::vector(); auto &realFilters = session->data().chatsFilters(); const auto &list = realFilters.list(); @@ -671,18 +671,18 @@ void FilterRowButton::paintEvent(QPaintEvent *e) { const auto tl = removed ? MTPDialogFilter() : row.filter.tl(newId); - const auto removeCommunityWithChats = removed - && row.filter.community() + const auto removeChatlistWithChats = removed + && row.filter.chatlist() && !row.removePeers.empty(); - if (removeCommunityWithChats) { + if (removeChatlistWithChats) { auto inputs = ranges::views::all( row.removePeers ) | ranges::views::transform([](not_null peer) { return MTPInputPeer(peer->input); }) | ranges::to(); - removeCommunityRequests.push_back( - MTPcommunities_LeaveCommunity( - MTP_inputCommunityDialogFilter(MTP_int(newId)), + removeChatlistRequests.push_back( + MTPchatlists_LeaveChatlist( + MTP_inputChatlistDialogFilter(MTP_int(newId)), MTP_vector(std::move(inputs)))); } else { const auto request = MTPmessages_UpdateDialogFilter( @@ -726,7 +726,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) { updates = std::move(updates), addRequests = std::move(addRequests), removeRequests = std::move(removeRequests), - removeCommunityRequests = std::move(removeCommunityRequests) + removeChatlistRequests = std::move(removeChatlistRequests) ] { const auto api = &session->api(); const auto filters = &session->data().chatsFilters(); @@ -760,7 +760,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) { } }; sendRequests(removeRequests); - sendRequests(removeCommunityRequests); + sendRequests(removeChatlistRequests); sendRequests(addRequests); if (!order.empty() && !addRequests.empty()) { filters->saveOrder(order, previousId); diff --git a/Telegram/SourceFiles/window/themes/window_theme.cpp b/Telegram/SourceFiles/window/themes/window_theme.cpp index b296da4933..286781b8c4 100644 --- a/Telegram/SourceFiles/window/themes/window_theme.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme.cpp @@ -644,6 +644,7 @@ void ChatBackground::checkUploadWallPaper() { _wallPaperUploadId = FullMsgId(); _wallPaperRequestId = _session->api().request( MTPaccount_UploadWallPaper( + MTP_flags(0), data.info.file, MTP_string("image/jpeg"), _paper.mtpSettings()