Replace "Members" with "Subscribers" in channel manage
This commit is contained in:
parent
dc13f5fb76
commit
2351d710b9
5 changed files with 30 additions and 15 deletions
|
|
@ -2313,5 +2313,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
"ktg_outdated_now" = "So that Kotatogram Desktop can update to newer versions.";
|
||||
"ktg_mac_menu_show" = "Show Kotatogram";
|
||||
|
||||
"ktg_manage_peer_subscribers" = "Subscribers";
|
||||
|
||||
// Keys finished
|
||||
|
|
|
|||
|
|
@ -77,5 +77,6 @@
|
|||
"ktg_language_not_ready_about": "К сожалению, в этом неофициальном переводе ({lang_name}) нет текстов приложения Kotatogram Desktop. Вы можете использовать {link}, чтобы помочь с переводом приложения.",
|
||||
"ktg_outdated_soon": "Иначе приложение перестанет обновляться с {date}.",
|
||||
"ktg_outdated_now": "Чтобы приложение Kotatogram могло получать обновления.",
|
||||
"ktg_mac_menu_show": "Показать Kotatogram"
|
||||
"ktg_mac_menu_show": "Показать Kotatogram",
|
||||
"ktg_manage_peer_subscribers": "Подписчики"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -517,6 +517,7 @@ UserData *ParticipantsAdditionalData::applyParticipant(
|
|||
return data.match([&](const MTPDchannelParticipantCreator &data) {
|
||||
if (overrideRole != Role::Profile
|
||||
&& overrideRole != Role::Members
|
||||
&& overrideRole != Role::Subscribers
|
||||
&& overrideRole != Role::Admins) {
|
||||
return logBad();
|
||||
}
|
||||
|
|
@ -524,25 +525,29 @@ 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::Members
|
||||
&& overrideRole != Role::Subscribers) {
|
||||
return logBad();
|
||||
}
|
||||
return applyRegular(data.vuser_id());
|
||||
}, [&](const MTPDchannelParticipant &data) {
|
||||
if (overrideRole != Role::Profile
|
||||
&& overrideRole != Role::Members) {
|
||||
&& overrideRole != Role::Members
|
||||
&& overrideRole != Role::Subscribers) {
|
||||
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();
|
||||
|
|
@ -833,6 +838,7 @@ void ParticipantsBoxController::Start(
|
|||
|
||||
switch (role) {
|
||||
case Role::Members:
|
||||
case Role::Subscribers:
|
||||
return chat
|
||||
? chat->canAddMembers()
|
||||
: (channel->canAddMembers()
|
||||
|
|
@ -854,6 +860,7 @@ 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();
|
||||
|
|
@ -880,7 +887,7 @@ void ParticipantsBoxController::Start(
|
|||
void ParticipantsBoxController::addNewItem() {
|
||||
Expects(_role != Role::Profile);
|
||||
|
||||
if (_role == Role::Members) {
|
||||
if (_role == Role::Members || _role == Role::Subscribers) {
|
||||
addNewParticipants();
|
||||
return;
|
||||
}
|
||||
|
|
@ -1056,6 +1063,7 @@ 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();
|
||||
}
|
||||
|
|
@ -1080,7 +1088,7 @@ void ParticipantsBoxController::prepare() {
|
|||
}
|
||||
|
||||
void ParticipantsBoxController::prepareChatRows(not_null<ChatData*> chat) {
|
||||
if (_role == Role::Profile || _role == Role::Members) {
|
||||
if (_role == Role::Profile || _role == Role::Members || _role == Role::Subscribers) {
|
||||
_onlineSorter = std::make_unique<ParticipantsOnlineSorter>(
|
||||
chat,
|
||||
delegate());
|
||||
|
|
@ -1113,6 +1121,7 @@ void ParticipantsBoxController::prepareChatRows(not_null<ChatData*> chat) {
|
|||
void ParticipantsBoxController::rebuildChatRows(not_null<ChatData*> chat) {
|
||||
switch (_role) {
|
||||
case Role::Profile:
|
||||
case Role::Subscribers:
|
||||
case Role::Members: return rebuildChatParticipants(chat);
|
||||
case Role::Admins: return rebuildChatAdmins(chat);
|
||||
case Role::Restricted:
|
||||
|
|
@ -1235,7 +1244,7 @@ void ParticipantsBoxController::loadMoreRows() {
|
|||
}
|
||||
|
||||
const auto filter = [&] {
|
||||
if (_role == Role::Members || _role == Role::Profile) {
|
||||
if (_role == Role::Members || _role == Role::Subscribers || _role == Role::Profile) {
|
||||
return MTP_channelParticipantsRecent();
|
||||
} else if (_role == Role::Admins) {
|
||||
return MTP_channelParticipantsAdmins();
|
||||
|
|
@ -1262,7 +1271,7 @@ void ParticipantsBoxController::loadMoreRows() {
|
|||
_loadRequestId = 0;
|
||||
|
||||
auto wasRecentRequest = firstLoad
|
||||
&& (_role == Role::Members || _role == Role::Profile);
|
||||
&& (_role == Role::Members || _role == Role::Subscribers || _role == Role::Profile);
|
||||
auto parseParticipants = [&](auto &&result, auto &&callback) {
|
||||
if (wasRecentRequest) {
|
||||
channel->session().api().parseRecentChannelParticipants(
|
||||
|
|
@ -1316,7 +1325,7 @@ void ParticipantsBoxController::refreshDescription() {
|
|||
}
|
||||
|
||||
bool ParticipantsBoxController::feedMegagroupLastParticipants() {
|
||||
if ((_role != Role::Members && _role != Role::Profile)
|
||||
if ((_role != Role::Members && _role != Role::Subscribers && _role != Role::Profile)
|
||||
|| delegate()->peerListFullRowsCount() > 0) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1377,7 +1386,7 @@ void ParticipantsBoxController::rowActionClicked(
|
|||
Expects(row->peer()->isUser());
|
||||
|
||||
const auto user = row->peer()->asUser();
|
||||
if (_role == Role::Members || _role == Role::Profile) {
|
||||
if (_role == Role::Members || _role == Role::Subscribers || _role == Role::Profile) {
|
||||
kickMember(user);
|
||||
} else if (_role == Role::Admins) {
|
||||
removeAdmin(user);
|
||||
|
|
@ -1589,7 +1598,8 @@ void ParticipantsBoxController::editRestrictedDone(
|
|||
prependRow(user);
|
||||
} else if (_role == Role::Admins
|
||||
|| _role == Role::Restricted
|
||||
|| _role == Role::Members) {
|
||||
|| _role == Role::Members
|
||||
|| _role == Role::Subscribers) {
|
||||
removeRow(user);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1597,7 +1607,8 @@ void ParticipantsBoxController::editRestrictedDone(
|
|||
prependRow(user);
|
||||
} else if (_role == Role::Kicked
|
||||
|| _role == Role::Admins
|
||||
|| _role == Role::Members) {
|
||||
|| _role == Role::Members
|
||||
|| _role == Role::Subscribers) {
|
||||
removeRow(user);
|
||||
}
|
||||
}
|
||||
|
|
@ -1778,7 +1789,7 @@ std::unique_ptr<PeerListRow> ParticipantsBoxController::createRow(
|
|||
if (_additional.canRestrictUser(user)) {
|
||||
row->setActionLink(tr::lng_profile_delete_removed(tr::now));
|
||||
}
|
||||
} else if (_role == Role::Members) {
|
||||
} else if (_role == Role::Members || _role == Role::Subscribers) {
|
||||
if ((chat ? chat->canBanMembers() : channel->canBanMembers())
|
||||
&& !_additional.isCreator(user)
|
||||
&& (!_additional.adminRights(user)
|
||||
|
|
@ -1989,6 +2000,7 @@ 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:
|
||||
|
|
@ -2067,7 +2079,7 @@ void ParticipantsBoxSearchController::searchDone(
|
|||
_allLoaded = true;
|
||||
}
|
||||
const auto overrideRole = (_role == Role::Admins)
|
||||
? Role::Members
|
||||
? (_channel->isMegagroup() ? Role::Members : Role::Subscribers)
|
||||
: _role;
|
||||
for (const auto &data : list) {
|
||||
const auto user = _additional->applyParticipant(
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ void SubscribeToMigration(
|
|||
enum class ParticipantsRole {
|
||||
Profile,
|
||||
Members,
|
||||
Subscribers,
|
||||
Admins,
|
||||
Restricted,
|
||||
Kicked,
|
||||
|
|
|
|||
|
|
@ -965,7 +965,7 @@ void Controller::fillManageSection() {
|
|||
if (canViewMembers) {
|
||||
AddButtonWithCount(
|
||||
_controls.buttonsLayout,
|
||||
tr::lng_manage_peer_members(),
|
||||
(_isGroup ? tr::lng_manage_peer_members() : tr::ktg_manage_peer_subscribers()),
|
||||
Info::Profile::MigratedOrMeValue(
|
||||
_peer
|
||||
) | rpl::map(
|
||||
|
|
@ -976,7 +976,7 @@ void Controller::fillManageSection() {
|
|||
ParticipantsBoxController::Start(
|
||||
navigation,
|
||||
_peer,
|
||||
ParticipantsBoxController::Role::Members);
|
||||
(_isGroup ? ParticipantsBoxController::Role::Members : ParticipantsBoxController::Role::Subscribers));
|
||||
},
|
||||
st::infoIconMembers);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue