mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 22:46:10 +00:00
Show admins in participants_hidden group info.
This commit is contained in:
@@ -932,9 +932,7 @@ void ActionsFiller::addLeaveChannelAction(not_null<ChannelData*> channel) {
|
||||
|
||||
AddActionButton(
|
||||
_wrap,
|
||||
(channel->isMegagroup()
|
||||
? tr::lng_profile_leave_group()
|
||||
: tr::lng_profile_leave_channel()),
|
||||
tr::lng_profile_leave_channel(),
|
||||
AmInChannelValue(channel),
|
||||
Window::DeleteAndLeaveHandler(
|
||||
_controller->parentController(),
|
||||
@@ -950,9 +948,7 @@ void ActionsFiller::addJoinChannelAction(
|
||||
| rpl::start_spawning(_wrap->lifetime());
|
||||
AddActionButton(
|
||||
_wrap,
|
||||
(channel->isMegagroup()
|
||||
? tr::lng_profile_join_group()
|
||||
: tr::lng_profile_join_channel()),
|
||||
tr::lng_profile_join_channel(),
|
||||
rpl::duplicate(joinVisible),
|
||||
[=] { channel->session().api().joinChannel(channel); },
|
||||
&st::infoIconAddMember);
|
||||
@@ -1003,14 +999,7 @@ void ActionsFiller::fillChannelActions(
|
||||
}
|
||||
|
||||
object_ptr<Ui::RpWidget> ActionsFiller::fill() {
|
||||
const auto wrapToggled = [=](
|
||||
object_ptr<Ui::RpWidget> content,
|
||||
rpl::producer<bool> shown) {
|
||||
auto result = object_ptr<Ui::SlideWrap<>>(_parent, std::move(content));
|
||||
result->setDuration(0)->toggleOn(std::move(shown));
|
||||
return result;
|
||||
};
|
||||
const auto wrapResult = [=](auto &&callback) {
|
||||
auto wrapResult = [=](auto &&callback) {
|
||||
_wrap = object_ptr<Ui::VerticalLayout>(_parent);
|
||||
_wrap->add(CreateSkipWidget(_wrap));
|
||||
callback();
|
||||
@@ -1022,11 +1011,8 @@ object_ptr<Ui::RpWidget> ActionsFiller::fill() {
|
||||
fillUserActions(user);
|
||||
});
|
||||
} else if (auto channel = _peer->asChannel()) {
|
||||
if (const auto megagroup = channel->asMegagroup()) {
|
||||
using namespace rpl::mappers;
|
||||
return wrapToggled(wrapResult([=] {
|
||||
fillChannelActions(megagroup);
|
||||
}), CanViewParticipantsValue(megagroup) | rpl::map(!_1));
|
||||
if (channel->isMegagroup()) {
|
||||
return { nullptr };
|
||||
}
|
||||
return wrapResult([=] {
|
||||
fillChannelActions(channel);
|
||||
|
Reference in New Issue
Block a user