2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Correctly track mute button scheduled state.

This commit is contained in:
John Preston
2021-04-05 16:28:25 +04:00
parent 15d17c8b0e
commit 088fda4ed8
12 changed files with 292 additions and 204 deletions

View File

@@ -320,6 +320,20 @@ rpl::producer<bool> CanPinMessagesValue(not_null<PeerData*> peer) {
Unexpected("Peer type in CanPinMessagesValue.");
}
rpl::producer<bool> CanManageGroupCallValue(not_null<PeerData*> peer) {
const auto flag = MTPDchatAdminRights::Flag::f_manage_call;
if (const auto chat = peer->asChat()) {
return chat->amCreator()
? (rpl::single(true) | rpl::type_erased())
: AdminRightValue(chat, flag);
} else if (const auto channel = peer->asChannel()) {
return channel->amCreator()
? (rpl::single(true) | rpl::type_erased())
: AdminRightValue(channel, flag);
}
return rpl::single(false);
}
TimeId SortByOnlineValue(not_null<UserData*> user, TimeId now) {
if (user->isServiceUser() || user->isBot()) {
return -1;