2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Allow creating approve-only invite links.

This commit is contained in:
John Preston
2021-10-12 12:39:07 +04:00
parent e471d61d7a
commit 3af3f85f82
20 changed files with 259 additions and 52 deletions

View File

@@ -239,6 +239,25 @@ rpl::producer<int> MembersCountValue(not_null<PeerData*> peer) {
Unexpected("User in MembersCountViewer().");
}
rpl::producer<int> PendingRequestsCountValue(not_null<PeerData*> peer) {
if (const auto chat = peer->asChat()) {
return peer->session().changes().peerFlagsValue(
peer,
UpdateFlag::PendingRequests
) | rpl::map([=] {
return chat->pendingRequestsCount();
});
} else if (const auto channel = peer->asChannel()) {
return peer->session().changes().peerFlagsValue(
peer,
UpdateFlag::PendingRequests
) | rpl::map([=] {
return channel->pendingRequestsCount();
});
}
Unexpected("User in MembersCountViewer().");
}
rpl::producer<int> AdminsCountValue(not_null<PeerData*> peer) {
if (const auto chat = peer->asChat()) {
return peer->session().changes().peerFlagsValue(