2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Simplify pin_messages/manage_topics logic.

This commit is contained in:
John Preston
2022-10-24 15:52:43 +04:00
parent 72354f52d4
commit b4a9705564
14 changed files with 16 additions and 59 deletions

View File

@@ -264,7 +264,7 @@ rpl::producer<bool> CanPinMessagesValue(not_null<PeerData*> peer) {
| ChatDataFlag::Creator;
return rpl::combine(
PeerFlagsValue(chat, mask),
AdminRightValue(chat, ChatAdminRight::PinMessagesOrTopics),
AdminRightValue(chat, ChatAdminRight::PinMessages),
DefaultRestrictionValue(chat, ChatRestriction::PinMessages),
[](
ChatDataFlags flags,
@@ -284,7 +284,7 @@ rpl::producer<bool> CanPinMessagesValue(not_null<PeerData*> peer) {
return rpl::single(true);
}
return rpl::combine(
AdminRightValue(megagroup, ChatAdminRight::PinMessagesOrTopics),
AdminRightValue(megagroup, ChatAdminRight::PinMessages),
DefaultRestrictionValue(megagroup, ChatRestriction::PinMessages),
PeerFlagsValue(
megagroup,