From be2444b3da53eb7cb423cb83add6e0a17ad9c139 Mon Sep 17 00:00:00 2001 From: RadRussianRus Date: Fri, 1 May 2020 17:18:02 +0300 Subject: [PATCH] Merge prepare: revert "subscribers" instead of "members" --- Telegram/Resources/langs/lang.strings | 6 ---- Telegram/Resources/langs/rewrites/ru.json | 8 ----- .../boxes/peers/edit_participants_box.cpp | 36 +++++++------------ .../boxes/peers/edit_participants_box.h | 1 - .../boxes/peers/edit_peer_info_box.cpp | 4 +-- .../view/history_view_top_bar_widget.cpp | 4 +-- Telegram/SourceFiles/info/info_top_bar.cpp | 5 --- .../info/profile/info_profile_actions.cpp | 2 +- .../info/profile/info_profile_cover.cpp | 13 +++---- 9 files changed, 20 insertions(+), 59 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index df663e557..cbe2f0e20 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -2438,12 +2438,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "ktg_user_status_unaccessible" = "account inaccessible"; -"ktg_chat_status_subscribers#one" = "{count} subscriber"; -"ktg_chat_status_subscribers#other" = "{count} subscribers"; - -"ktg_profile_subscribers_section" = "Subscribers"; -"ktg_manage_peer_subscribers" = "Subscribers"; - "ktg_settings_show_json_settings" = "Show custom settings"; "ktg_settings_restart" = "Restart Kotatogram"; diff --git a/Telegram/Resources/langs/rewrites/ru.json b/Telegram/Resources/langs/rewrites/ru.json index 2e64461d9..bfe8abb54 100644 --- a/Telegram/Resources/langs/rewrites/ru.json +++ b/Telegram/Resources/langs/rewrites/ru.json @@ -34,14 +34,6 @@ "ktg_mac_menu_show": "Показать Kotatogram", "ktg_settings_kotato": "Настройки Kotatogram", "ktg_user_status_unaccessible": "аккаунт недоступен", - "ktg_chat_status_subscribers": { - "one": "{count} подписчик", - "few": "{count} подписчика", - "many": "{count} подписчиков", - "other": "{count} подписчиков" - }, - "ktg_profile_subscribers_section": "Подписчики", - "ktg_manage_peer_subscribers": "Подписчики", "ktg_settings_show_json_settings": "Показать файл настроек", "ktg_settings_restart": "Перезапустить Kotatogram", "ktg_copy_btn_callback": "Копировать callback-данные", diff --git a/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp index ba9c5f61d..329269cd3 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp @@ -517,7 +517,6 @@ UserData *ParticipantsAdditionalData::applyParticipant( return data.match([&](const MTPDchannelParticipantCreator &data) { if (overrideRole != Role::Profile && overrideRole != Role::Members - && overrideRole != Role::Subscribers && overrideRole != Role::Admins) { return logBad(); } @@ -525,29 +524,25 @@ UserData *ParticipantsAdditionalData::applyParticipant( }, [&](const MTPDchannelParticipantAdmin &data) { if (overrideRole != Role::Profile && overrideRole != Role::Members - && overrideRole != Role::Subscribers && overrideRole != Role::Admins) { return logBad(); } return applyAdmin(data); }, [&](const MTPDchannelParticipantSelf &data) { if (overrideRole != Role::Profile - && overrideRole != Role::Members - && overrideRole != Role::Subscribers) { + && overrideRole != Role::Members) { return logBad(); } return applyRegular(data.vuser_id()); }, [&](const MTPDchannelParticipant &data) { if (overrideRole != Role::Profile - && overrideRole != Role::Members - && overrideRole != Role::Subscribers) { + && overrideRole != Role::Members) { return logBad(); } return applyRegular(data.vuser_id()); }, [&](const MTPDchannelParticipantBanned &data) { if (overrideRole != Role::Profile && overrideRole != Role::Members - && overrideRole != Role::Subscribers && overrideRole != Role::Restricted && overrideRole != Role::Kicked) { return logBad(); @@ -839,7 +834,6 @@ void ParticipantsBoxController::Start( switch (role) { case Role::Members: - case Role::Subscribers: return chat ? chat->canAddMembers() : (channel->canAddMembers() @@ -861,7 +855,6 @@ void ParticipantsBoxController::Start( auto addNewItemText = [&] { switch (role) { case Role::Members: - case Role::Subscribers: return (chat || channel->isMegagroup()) ? tr::lng_channel_add_members() : tr::lng_channel_add_users(); @@ -888,7 +881,7 @@ void ParticipantsBoxController::Start( void ParticipantsBoxController::addNewItem() { Expects(_role != Role::Profile); - if (_role == Role::Members || _role == Role::Subscribers) { + if (_role == Role::Members) { addNewParticipants(); return; } @@ -1064,7 +1057,6 @@ void ParticipantsBoxController::prepare() { case Role::Admins: return tr::lng_channel_admins(); case Role::Profile: case Role::Members: return tr::lng_profile_participants_section(); - case Role::Subscribers: return tr::ktg_profile_subscribers_section(); case Role::Restricted: return tr::lng_exceptions_list_title(); case Role::Kicked: return tr::lng_removed_list_title(); } @@ -1089,7 +1081,7 @@ void ParticipantsBoxController::prepare() { } void ParticipantsBoxController::prepareChatRows(not_null chat) { - if (_role == Role::Profile || _role == Role::Members || _role == Role::Subscribers) { + if (_role == Role::Profile || _role == Role::Members) { _onlineSorter = std::make_unique( chat, delegate()); @@ -1122,7 +1114,6 @@ void ParticipantsBoxController::prepareChatRows(not_null chat) { void ParticipantsBoxController::rebuildChatRows(not_null chat) { switch (_role) { case Role::Profile: - case Role::Subscribers: case Role::Members: return rebuildChatParticipants(chat); case Role::Admins: return rebuildChatAdmins(chat); case Role::Restricted: @@ -1245,7 +1236,7 @@ void ParticipantsBoxController::loadMoreRows() { } const auto filter = [&] { - if (_role == Role::Members || _role == Role::Subscribers || _role == Role::Profile) { + if (_role == Role::Members || _role == Role::Profile) { return MTP_channelParticipantsRecent(); } else if (_role == Role::Admins) { return MTP_channelParticipantsAdmins(); @@ -1272,7 +1263,7 @@ void ParticipantsBoxController::loadMoreRows() { _loadRequestId = 0; auto wasRecentRequest = firstLoad - && (_role == Role::Members || _role == Role::Subscribers || _role == Role::Profile); + && (_role == Role::Members || _role == Role::Profile); auto parseParticipants = [&](auto &&result, auto &&callback) { if (wasRecentRequest) { channel->session().api().parseRecentChannelParticipants( @@ -1326,7 +1317,7 @@ void ParticipantsBoxController::refreshDescription() { } bool ParticipantsBoxController::feedMegagroupLastParticipants() { - if ((_role != Role::Members && _role != Role::Subscribers && _role != Role::Profile) + if ((_role != Role::Members && _role != Role::Profile) || delegate()->peerListFullRowsCount() > 0) { return false; } @@ -1387,7 +1378,7 @@ void ParticipantsBoxController::rowActionClicked( Expects(row->peer()->isUser()); const auto user = row->peer()->asUser(); - if (_role == Role::Members || _role == Role::Subscribers || _role == Role::Profile) { + if (_role == Role::Members || _role == Role::Profile) { kickMember(user); } else if (_role == Role::Admins) { removeAdmin(user); @@ -1602,8 +1593,7 @@ void ParticipantsBoxController::editRestrictedDone( prependRow(user); } else if (_role == Role::Admins || _role == Role::Restricted - || _role == Role::Members - || _role == Role::Subscribers) { + || _role == Role::Members) { removeRow(user); } } else { @@ -1611,8 +1601,7 @@ void ParticipantsBoxController::editRestrictedDone( prependRow(user); } else if (_role == Role::Kicked || _role == Role::Admins - || _role == Role::Members - || _role == Role::Subscribers) { + || _role == Role::Members) { removeRow(user); } } @@ -1793,7 +1782,7 @@ std::unique_ptr ParticipantsBoxController::createRow( if (_additional.canRestrictUser(user)) { row->setActionLink(tr::lng_profile_delete_removed(tr::now)); } - } else if (_role == Role::Members || _role == Role::Subscribers) { + } else if (_role == Role::Members) { if ((chat ? chat->canBanMembers() : channel->canBanMembers()) && !_additional.isCreator(user) && (!_additional.adminRights(user) @@ -2005,7 +1994,6 @@ bool ParticipantsBoxSearchController::loadMoreRows() { switch (_role) { case Role::Admins: // Search for members, appoint as admin on found. case Role::Profile: - case Role::Subscribers: case Role::Members: return MTP_channelParticipantsSearch(MTP_string(_query)); case Role::Restricted: @@ -2084,7 +2072,7 @@ void ParticipantsBoxSearchController::searchDone( _allLoaded = true; } const auto overrideRole = (_role == Role::Admins) - ? (_channel->isMegagroup() ? Role::Members : Role::Subscribers) + ? Role::Members : _role; for (const auto &data : list) { const auto user = _additional->applyParticipant( diff --git a/Telegram/SourceFiles/boxes/peers/edit_participants_box.h b/Telegram/SourceFiles/boxes/peers/edit_participants_box.h index 0e958751f..fd36c97ce 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_participants_box.h +++ b/Telegram/SourceFiles/boxes/peers/edit_participants_box.h @@ -45,7 +45,6 @@ void SubscribeToMigration( enum class ParticipantsRole { Profile, Members, - Subscribers, Admins, Restricted, Kicked, diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp index 3885ec4aa..4732f50f6 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp @@ -967,7 +967,7 @@ void Controller::fillManageSection() { if (canViewMembers) { AddButtonWithCount( _controls.buttonsLayout, - (_isGroup ? tr::lng_manage_peer_members() : tr::ktg_manage_peer_subscribers()), + tr::lng_manage_peer_members(), Info::Profile::MigratedOrMeValue( _peer ) | rpl::map( @@ -978,7 +978,7 @@ void Controller::fillManageSection() { ParticipantsBoxController::Start( navigation, _peer, - (_isGroup ? ParticipantsBoxController::Role::Members : ParticipantsBoxController::Role::Subscribers)); + ParticipantsBoxController::Role::Members); }, st::infoIconMembers); } diff --git a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp index e2e1ce4df..b86087c6c 100644 --- a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp @@ -921,9 +921,7 @@ void TopBarWidget::updateOnlineDisplay() { text = tr::lng_group_status(tr::now); } } else if (channel->membersCount() > 0) { - text = channel->isMegagroup() - ? tr::lng_chat_status_members(tr::now, lt_count_decimal, channel->membersCount()) - : tr::ktg_chat_status_subscribers(tr::now, lt_count_decimal, channel->membersCount()); + text = tr::lng_chat_status_members(tr::now, lt_count_decimal, channel->membersCount()); } else { text = channel->isMegagroup() ? tr::lng_group_status(tr::now) : tr::lng_channel_status(tr::now); diff --git a/Telegram/SourceFiles/info/info_top_bar.cpp b/Telegram/SourceFiles/info/info_top_bar.cpp index 209ec23a8..6079eeabb 100644 --- a/Telegram/SourceFiles/info/info_top_bar.cpp +++ b/Telegram/SourceFiles/info/info_top_bar.cpp @@ -605,11 +605,6 @@ rpl::producer TitleValue( return tr::lng_profile_common_groups_section(); case Section::Type::Members: - if (const auto channel = peer->asChannel()) { - return channel->isMegagroup() - ? tr::lng_profile_participants_section() - : tr::ktg_profile_subscribers_section(); - } return tr::lng_profile_participants_section(); //case Section::Type::Channels: // #feed diff --git a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp index 5de181dae..f806e55db 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp @@ -883,7 +883,7 @@ object_ptr SetupChannelMembers( channel, MTPDchannelFull::Flag::f_can_view_participants), (_1 > 0) && _2); - auto membersText = tr::ktg_chat_status_subscribers( + auto membersText = tr::lng_chat_status_members( lt_count_decimal, MembersCountValue(channel) | tr::to_count()); auto membersCallback = [=] { diff --git a/Telegram/SourceFiles/info/profile/info_profile_cover.cpp b/Telegram/SourceFiles/info/profile/info_profile_cover.cpp index b3b06e4a6..bd953a0d5 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_cover.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_cover.cpp @@ -146,15 +146,10 @@ auto ChatStatusText(int fullCount, int onlineCount, bool isGroup) { lt_online_count, OnlineStatusText(onlineCount)); } else if (fullCount > 0) { - return isGroup - ? tr::lng_chat_status_members( - tr::now, - lt_count_decimal, - fullCount) - : tr::ktg_chat_status_subscribers( - tr::now, - lt_count_decimal, - fullCount); + return tr::lng_chat_status_members( + tr::now, + lt_count_decimal, + fullCount); } return isGroup ? tr::lng_group_status(tr::now)