mirror of https://github.com/procxx/kepka.git
Fix manage group box after migration.
This commit is contained in:
parent
328b090877
commit
055c145af5
|
@ -920,8 +920,12 @@ void Controller::fillManageSection() {
|
|||
AddButtonWithCount(
|
||||
_controls.buttonsLayout,
|
||||
tr::lng_manage_peer_permissions(),
|
||||
Info::Profile::RestrictionsCountValue(_peer)
|
||||
| ToPositiveNumberStringRestrictions(),
|
||||
Info::Profile::MigratedOrMeValue(
|
||||
_peer
|
||||
) | rpl::map(
|
||||
Info::Profile::RestrictionsCountValue
|
||||
) | rpl::flatten_latest(
|
||||
) | ToPositiveNumberStringRestrictions(),
|
||||
[=] { ShowEditPermissions(_peer); },
|
||||
st::infoIconPermissions);
|
||||
}
|
||||
|
@ -929,8 +933,12 @@ void Controller::fillManageSection() {
|
|||
AddButtonWithCount(
|
||||
_controls.buttonsLayout,
|
||||
tr::lng_manage_peer_administrators(),
|
||||
Info::Profile::AdminsCountValue(_peer)
|
||||
| ToPositiveNumberString(),
|
||||
Info::Profile::MigratedOrMeValue(
|
||||
_peer
|
||||
) | rpl::map(
|
||||
Info::Profile::AdminsCountValue
|
||||
) | rpl::flatten_latest(
|
||||
) | ToPositiveNumberString(),
|
||||
[=] {
|
||||
ParticipantsBoxController::Start(
|
||||
navigation,
|
||||
|
@ -943,8 +951,12 @@ void Controller::fillManageSection() {
|
|||
AddButtonWithCount(
|
||||
_controls.buttonsLayout,
|
||||
tr::lng_manage_peer_members(),
|
||||
Info::Profile::MembersCountValue(_peer)
|
||||
| ToPositiveNumberString(),
|
||||
Info::Profile::MigratedOrMeValue(
|
||||
_peer
|
||||
) | rpl::map(
|
||||
Info::Profile::MembersCountValue
|
||||
) | rpl::flatten_latest(
|
||||
) | ToPositiveNumberString(),
|
||||
[=] {
|
||||
ParticipantsBoxController::Start(
|
||||
navigation,
|
||||
|
|
|
@ -276,6 +276,21 @@ rpl::producer<int> RestrictionsCountValue(not_null<PeerData*> peer) {
|
|||
Unexpected("User in RestrictionsCountValue().");
|
||||
}
|
||||
|
||||
rpl::producer<not_null<PeerData*>> MigratedOrMeValue(
|
||||
not_null<PeerData*> peer) {
|
||||
using Flag = Notify::PeerUpdate::Flag;
|
||||
if (const auto chat = peer->asChat()) {
|
||||
return Notify::PeerUpdateValue(
|
||||
chat,
|
||||
Flag::MigrationChanged
|
||||
) | rpl::map([=] {
|
||||
return chat->migrateToOrMe();
|
||||
});
|
||||
} else {
|
||||
return rpl::single(peer);
|
||||
}
|
||||
}
|
||||
|
||||
rpl::producer<int> RestrictedCountValue(not_null<ChannelData*> channel) {
|
||||
using Flag = Notify::PeerUpdate::Flag;
|
||||
return Notify::PeerUpdateValue(
|
||||
|
|
|
@ -32,6 +32,9 @@ inline auto ToSingleLine() {
|
|||
});
|
||||
}
|
||||
|
||||
rpl::producer<not_null<PeerData*>> MigratedOrMeValue(
|
||||
not_null<PeerData*> peer);
|
||||
|
||||
rpl::producer<TextWithEntities> NameValue(not_null<PeerData*> peer);
|
||||
rpl::producer<TextWithEntities> PhoneValue(not_null<UserData*> user);
|
||||
rpl::producer<TextWithEntities> PhoneOrHiddenValue(not_null<UserData*> user);
|
||||
|
|
Loading…
Reference in New Issue