Merge prepare: revert "subscribers" instead of "members"
This commit is contained in:
parent
e7eb585475
commit
be2444b3da
9 changed files with 20 additions and 59 deletions
|
|
@ -2438,12 +2438,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
"ktg_user_status_unaccessible" = "account inaccessible";
|
"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_show_json_settings" = "Show custom settings";
|
||||||
"ktg_settings_restart" = "Restart Kotatogram";
|
"ktg_settings_restart" = "Restart Kotatogram";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,14 +34,6 @@
|
||||||
"ktg_mac_menu_show": "Показать Kotatogram",
|
"ktg_mac_menu_show": "Показать Kotatogram",
|
||||||
"ktg_settings_kotato": "Настройки Kotatogram",
|
"ktg_settings_kotato": "Настройки Kotatogram",
|
||||||
"ktg_user_status_unaccessible": "аккаунт недоступен",
|
"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_show_json_settings": "Показать файл настроек",
|
||||||
"ktg_settings_restart": "Перезапустить Kotatogram",
|
"ktg_settings_restart": "Перезапустить Kotatogram",
|
||||||
"ktg_copy_btn_callback": "Копировать callback-данные",
|
"ktg_copy_btn_callback": "Копировать callback-данные",
|
||||||
|
|
|
||||||
|
|
@ -517,7 +517,6 @@ UserData *ParticipantsAdditionalData::applyParticipant(
|
||||||
return data.match([&](const MTPDchannelParticipantCreator &data) {
|
return data.match([&](const MTPDchannelParticipantCreator &data) {
|
||||||
if (overrideRole != Role::Profile
|
if (overrideRole != Role::Profile
|
||||||
&& overrideRole != Role::Members
|
&& overrideRole != Role::Members
|
||||||
&& overrideRole != Role::Subscribers
|
|
||||||
&& overrideRole != Role::Admins) {
|
&& overrideRole != Role::Admins) {
|
||||||
return logBad();
|
return logBad();
|
||||||
}
|
}
|
||||||
|
|
@ -525,29 +524,25 @@ UserData *ParticipantsAdditionalData::applyParticipant(
|
||||||
}, [&](const MTPDchannelParticipantAdmin &data) {
|
}, [&](const MTPDchannelParticipantAdmin &data) {
|
||||||
if (overrideRole != Role::Profile
|
if (overrideRole != Role::Profile
|
||||||
&& overrideRole != Role::Members
|
&& overrideRole != Role::Members
|
||||||
&& overrideRole != Role::Subscribers
|
|
||||||
&& overrideRole != Role::Admins) {
|
&& overrideRole != Role::Admins) {
|
||||||
return logBad();
|
return logBad();
|
||||||
}
|
}
|
||||||
return applyAdmin(data);
|
return applyAdmin(data);
|
||||||
}, [&](const MTPDchannelParticipantSelf &data) {
|
}, [&](const MTPDchannelParticipantSelf &data) {
|
||||||
if (overrideRole != Role::Profile
|
if (overrideRole != Role::Profile
|
||||||
&& overrideRole != Role::Members
|
&& overrideRole != Role::Members) {
|
||||||
&& overrideRole != Role::Subscribers) {
|
|
||||||
return logBad();
|
return logBad();
|
||||||
}
|
}
|
||||||
return applyRegular(data.vuser_id());
|
return applyRegular(data.vuser_id());
|
||||||
}, [&](const MTPDchannelParticipant &data) {
|
}, [&](const MTPDchannelParticipant &data) {
|
||||||
if (overrideRole != Role::Profile
|
if (overrideRole != Role::Profile
|
||||||
&& overrideRole != Role::Members
|
&& overrideRole != Role::Members) {
|
||||||
&& overrideRole != Role::Subscribers) {
|
|
||||||
return logBad();
|
return logBad();
|
||||||
}
|
}
|
||||||
return applyRegular(data.vuser_id());
|
return applyRegular(data.vuser_id());
|
||||||
}, [&](const MTPDchannelParticipantBanned &data) {
|
}, [&](const MTPDchannelParticipantBanned &data) {
|
||||||
if (overrideRole != Role::Profile
|
if (overrideRole != Role::Profile
|
||||||
&& overrideRole != Role::Members
|
&& overrideRole != Role::Members
|
||||||
&& overrideRole != Role::Subscribers
|
|
||||||
&& overrideRole != Role::Restricted
|
&& overrideRole != Role::Restricted
|
||||||
&& overrideRole != Role::Kicked) {
|
&& overrideRole != Role::Kicked) {
|
||||||
return logBad();
|
return logBad();
|
||||||
|
|
@ -839,7 +834,6 @@ void ParticipantsBoxController::Start(
|
||||||
|
|
||||||
switch (role) {
|
switch (role) {
|
||||||
case Role::Members:
|
case Role::Members:
|
||||||
case Role::Subscribers:
|
|
||||||
return chat
|
return chat
|
||||||
? chat->canAddMembers()
|
? chat->canAddMembers()
|
||||||
: (channel->canAddMembers()
|
: (channel->canAddMembers()
|
||||||
|
|
@ -861,7 +855,6 @@ void ParticipantsBoxController::Start(
|
||||||
auto addNewItemText = [&] {
|
auto addNewItemText = [&] {
|
||||||
switch (role) {
|
switch (role) {
|
||||||
case Role::Members:
|
case Role::Members:
|
||||||
case Role::Subscribers:
|
|
||||||
return (chat || channel->isMegagroup())
|
return (chat || channel->isMegagroup())
|
||||||
? tr::lng_channel_add_members()
|
? tr::lng_channel_add_members()
|
||||||
: tr::lng_channel_add_users();
|
: tr::lng_channel_add_users();
|
||||||
|
|
@ -888,7 +881,7 @@ void ParticipantsBoxController::Start(
|
||||||
void ParticipantsBoxController::addNewItem() {
|
void ParticipantsBoxController::addNewItem() {
|
||||||
Expects(_role != Role::Profile);
|
Expects(_role != Role::Profile);
|
||||||
|
|
||||||
if (_role == Role::Members || _role == Role::Subscribers) {
|
if (_role == Role::Members) {
|
||||||
addNewParticipants();
|
addNewParticipants();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1064,7 +1057,6 @@ void ParticipantsBoxController::prepare() {
|
||||||
case Role::Admins: return tr::lng_channel_admins();
|
case Role::Admins: return tr::lng_channel_admins();
|
||||||
case Role::Profile:
|
case Role::Profile:
|
||||||
case Role::Members: return tr::lng_profile_participants_section();
|
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::Restricted: return tr::lng_exceptions_list_title();
|
||||||
case Role::Kicked: return tr::lng_removed_list_title();
|
case Role::Kicked: return tr::lng_removed_list_title();
|
||||||
}
|
}
|
||||||
|
|
@ -1089,7 +1081,7 @@ void ParticipantsBoxController::prepare() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ParticipantsBoxController::prepareChatRows(not_null<ChatData*> chat) {
|
void ParticipantsBoxController::prepareChatRows(not_null<ChatData*> chat) {
|
||||||
if (_role == Role::Profile || _role == Role::Members || _role == Role::Subscribers) {
|
if (_role == Role::Profile || _role == Role::Members) {
|
||||||
_onlineSorter = std::make_unique<ParticipantsOnlineSorter>(
|
_onlineSorter = std::make_unique<ParticipantsOnlineSorter>(
|
||||||
chat,
|
chat,
|
||||||
delegate());
|
delegate());
|
||||||
|
|
@ -1122,7 +1114,6 @@ void ParticipantsBoxController::prepareChatRows(not_null<ChatData*> chat) {
|
||||||
void ParticipantsBoxController::rebuildChatRows(not_null<ChatData*> chat) {
|
void ParticipantsBoxController::rebuildChatRows(not_null<ChatData*> chat) {
|
||||||
switch (_role) {
|
switch (_role) {
|
||||||
case Role::Profile:
|
case Role::Profile:
|
||||||
case Role::Subscribers:
|
|
||||||
case Role::Members: return rebuildChatParticipants(chat);
|
case Role::Members: return rebuildChatParticipants(chat);
|
||||||
case Role::Admins: return rebuildChatAdmins(chat);
|
case Role::Admins: return rebuildChatAdmins(chat);
|
||||||
case Role::Restricted:
|
case Role::Restricted:
|
||||||
|
|
@ -1245,7 +1236,7 @@ void ParticipantsBoxController::loadMoreRows() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto filter = [&] {
|
const auto filter = [&] {
|
||||||
if (_role == Role::Members || _role == Role::Subscribers || _role == Role::Profile) {
|
if (_role == Role::Members || _role == Role::Profile) {
|
||||||
return MTP_channelParticipantsRecent();
|
return MTP_channelParticipantsRecent();
|
||||||
} else if (_role == Role::Admins) {
|
} else if (_role == Role::Admins) {
|
||||||
return MTP_channelParticipantsAdmins();
|
return MTP_channelParticipantsAdmins();
|
||||||
|
|
@ -1272,7 +1263,7 @@ void ParticipantsBoxController::loadMoreRows() {
|
||||||
_loadRequestId = 0;
|
_loadRequestId = 0;
|
||||||
|
|
||||||
auto wasRecentRequest = firstLoad
|
auto wasRecentRequest = firstLoad
|
||||||
&& (_role == Role::Members || _role == Role::Subscribers || _role == Role::Profile);
|
&& (_role == Role::Members || _role == Role::Profile);
|
||||||
auto parseParticipants = [&](auto &&result, auto &&callback) {
|
auto parseParticipants = [&](auto &&result, auto &&callback) {
|
||||||
if (wasRecentRequest) {
|
if (wasRecentRequest) {
|
||||||
channel->session().api().parseRecentChannelParticipants(
|
channel->session().api().parseRecentChannelParticipants(
|
||||||
|
|
@ -1326,7 +1317,7 @@ void ParticipantsBoxController::refreshDescription() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ParticipantsBoxController::feedMegagroupLastParticipants() {
|
bool ParticipantsBoxController::feedMegagroupLastParticipants() {
|
||||||
if ((_role != Role::Members && _role != Role::Subscribers && _role != Role::Profile)
|
if ((_role != Role::Members && _role != Role::Profile)
|
||||||
|| delegate()->peerListFullRowsCount() > 0) {
|
|| delegate()->peerListFullRowsCount() > 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -1387,7 +1378,7 @@ void ParticipantsBoxController::rowActionClicked(
|
||||||
Expects(row->peer()->isUser());
|
Expects(row->peer()->isUser());
|
||||||
|
|
||||||
const auto user = row->peer()->asUser();
|
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);
|
kickMember(user);
|
||||||
} else if (_role == Role::Admins) {
|
} else if (_role == Role::Admins) {
|
||||||
removeAdmin(user);
|
removeAdmin(user);
|
||||||
|
|
@ -1602,8 +1593,7 @@ void ParticipantsBoxController::editRestrictedDone(
|
||||||
prependRow(user);
|
prependRow(user);
|
||||||
} else if (_role == Role::Admins
|
} else if (_role == Role::Admins
|
||||||
|| _role == Role::Restricted
|
|| _role == Role::Restricted
|
||||||
|| _role == Role::Members
|
|| _role == Role::Members) {
|
||||||
|| _role == Role::Subscribers) {
|
|
||||||
removeRow(user);
|
removeRow(user);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1611,8 +1601,7 @@ void ParticipantsBoxController::editRestrictedDone(
|
||||||
prependRow(user);
|
prependRow(user);
|
||||||
} else if (_role == Role::Kicked
|
} else if (_role == Role::Kicked
|
||||||
|| _role == Role::Admins
|
|| _role == Role::Admins
|
||||||
|| _role == Role::Members
|
|| _role == Role::Members) {
|
||||||
|| _role == Role::Subscribers) {
|
|
||||||
removeRow(user);
|
removeRow(user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1793,7 +1782,7 @@ std::unique_ptr<PeerListRow> ParticipantsBoxController::createRow(
|
||||||
if (_additional.canRestrictUser(user)) {
|
if (_additional.canRestrictUser(user)) {
|
||||||
row->setActionLink(tr::lng_profile_delete_removed(tr::now));
|
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())
|
if ((chat ? chat->canBanMembers() : channel->canBanMembers())
|
||||||
&& !_additional.isCreator(user)
|
&& !_additional.isCreator(user)
|
||||||
&& (!_additional.adminRights(user)
|
&& (!_additional.adminRights(user)
|
||||||
|
|
@ -2005,7 +1994,6 @@ bool ParticipantsBoxSearchController::loadMoreRows() {
|
||||||
switch (_role) {
|
switch (_role) {
|
||||||
case Role::Admins: // Search for members, appoint as admin on found.
|
case Role::Admins: // Search for members, appoint as admin on found.
|
||||||
case Role::Profile:
|
case Role::Profile:
|
||||||
case Role::Subscribers:
|
|
||||||
case Role::Members:
|
case Role::Members:
|
||||||
return MTP_channelParticipantsSearch(MTP_string(_query));
|
return MTP_channelParticipantsSearch(MTP_string(_query));
|
||||||
case Role::Restricted:
|
case Role::Restricted:
|
||||||
|
|
@ -2084,7 +2072,7 @@ void ParticipantsBoxSearchController::searchDone(
|
||||||
_allLoaded = true;
|
_allLoaded = true;
|
||||||
}
|
}
|
||||||
const auto overrideRole = (_role == Role::Admins)
|
const auto overrideRole = (_role == Role::Admins)
|
||||||
? (_channel->isMegagroup() ? Role::Members : Role::Subscribers)
|
? Role::Members
|
||||||
: _role;
|
: _role;
|
||||||
for (const auto &data : list) {
|
for (const auto &data : list) {
|
||||||
const auto user = _additional->applyParticipant(
|
const auto user = _additional->applyParticipant(
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,6 @@ void SubscribeToMigration(
|
||||||
enum class ParticipantsRole {
|
enum class ParticipantsRole {
|
||||||
Profile,
|
Profile,
|
||||||
Members,
|
Members,
|
||||||
Subscribers,
|
|
||||||
Admins,
|
Admins,
|
||||||
Restricted,
|
Restricted,
|
||||||
Kicked,
|
Kicked,
|
||||||
|
|
|
||||||
|
|
@ -967,7 +967,7 @@ void Controller::fillManageSection() {
|
||||||
if (canViewMembers) {
|
if (canViewMembers) {
|
||||||
AddButtonWithCount(
|
AddButtonWithCount(
|
||||||
_controls.buttonsLayout,
|
_controls.buttonsLayout,
|
||||||
(_isGroup ? tr::lng_manage_peer_members() : tr::ktg_manage_peer_subscribers()),
|
tr::lng_manage_peer_members(),
|
||||||
Info::Profile::MigratedOrMeValue(
|
Info::Profile::MigratedOrMeValue(
|
||||||
_peer
|
_peer
|
||||||
) | rpl::map(
|
) | rpl::map(
|
||||||
|
|
@ -978,7 +978,7 @@ void Controller::fillManageSection() {
|
||||||
ParticipantsBoxController::Start(
|
ParticipantsBoxController::Start(
|
||||||
navigation,
|
navigation,
|
||||||
_peer,
|
_peer,
|
||||||
(_isGroup ? ParticipantsBoxController::Role::Members : ParticipantsBoxController::Role::Subscribers));
|
ParticipantsBoxController::Role::Members);
|
||||||
},
|
},
|
||||||
st::infoIconMembers);
|
st::infoIconMembers);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -921,9 +921,7 @@ void TopBarWidget::updateOnlineDisplay() {
|
||||||
text = tr::lng_group_status(tr::now);
|
text = tr::lng_group_status(tr::now);
|
||||||
}
|
}
|
||||||
} else if (channel->membersCount() > 0) {
|
} else if (channel->membersCount() > 0) {
|
||||||
text = channel->isMegagroup()
|
text = tr::lng_chat_status_members(tr::now, lt_count_decimal, channel->membersCount());
|
||||||
? tr::lng_chat_status_members(tr::now, lt_count_decimal, channel->membersCount())
|
|
||||||
: tr::ktg_chat_status_subscribers(tr::now, lt_count_decimal, channel->membersCount());
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
text = channel->isMegagroup() ? tr::lng_group_status(tr::now) : tr::lng_channel_status(tr::now);
|
text = channel->isMegagroup() ? tr::lng_group_status(tr::now) : tr::lng_channel_status(tr::now);
|
||||||
|
|
|
||||||
|
|
@ -605,11 +605,6 @@ rpl::producer<QString> TitleValue(
|
||||||
return tr::lng_profile_common_groups_section();
|
return tr::lng_profile_common_groups_section();
|
||||||
|
|
||||||
case Section::Type::Members:
|
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();
|
return tr::lng_profile_participants_section();
|
||||||
|
|
||||||
//case Section::Type::Channels: // #feed
|
//case Section::Type::Channels: // #feed
|
||||||
|
|
|
||||||
|
|
@ -883,7 +883,7 @@ object_ptr<Ui::RpWidget> SetupChannelMembers(
|
||||||
channel,
|
channel,
|
||||||
MTPDchannelFull::Flag::f_can_view_participants),
|
MTPDchannelFull::Flag::f_can_view_participants),
|
||||||
(_1 > 0) && _2);
|
(_1 > 0) && _2);
|
||||||
auto membersText = tr::ktg_chat_status_subscribers(
|
auto membersText = tr::lng_chat_status_members(
|
||||||
lt_count_decimal,
|
lt_count_decimal,
|
||||||
MembersCountValue(channel) | tr::to_count());
|
MembersCountValue(channel) | tr::to_count());
|
||||||
auto membersCallback = [=] {
|
auto membersCallback = [=] {
|
||||||
|
|
|
||||||
|
|
@ -146,15 +146,10 @@ auto ChatStatusText(int fullCount, int onlineCount, bool isGroup) {
|
||||||
lt_online_count,
|
lt_online_count,
|
||||||
OnlineStatusText(onlineCount));
|
OnlineStatusText(onlineCount));
|
||||||
} else if (fullCount > 0) {
|
} else if (fullCount > 0) {
|
||||||
return isGroup
|
return tr::lng_chat_status_members(
|
||||||
? tr::lng_chat_status_members(
|
tr::now,
|
||||||
tr::now,
|
lt_count_decimal,
|
||||||
lt_count_decimal,
|
fullCount);
|
||||||
fullCount)
|
|
||||||
: tr::ktg_chat_status_subscribers(
|
|
||||||
tr::now,
|
|
||||||
lt_count_decimal,
|
|
||||||
fullCount);
|
|
||||||
}
|
}
|
||||||
return isGroup
|
return isGroup
|
||||||
? tr::lng_group_status(tr::now)
|
? tr::lng_group_status(tr::now)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue