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

Fix removing chats from dialogs.

This commit is contained in:
John Preston
2019-01-22 17:05:06 +04:00
parent ebc2043055
commit bf87de3706
5 changed files with 17 additions and 19 deletions

View File

@@ -189,12 +189,12 @@ rpl::producer<bool> CanWriteValue(ChatData *chat) {
MTPDchat::Flags flags,
Data::Flags<ChatAdminRights>::Change adminRights,
bool defaultSendMessagesRestriction) {
const auto actionsUnavailableFlags = 0
const auto amOutFlags = 0
| MTPDchat::Flag::f_deactivated
| MTPDchat_ClientFlag::f_forbidden
| MTPDchat::Flag::f_left
| MTPDchat::Flag::f_kicked;
return !(flags & actionsUnavailableFlags)
return !(flags & amOutFlags)
&& ((flags & MTPDchat::Flag::f_creator)
|| (adminRights.value != MTPDchatAdminRights::Flags(0))
|| !defaultSendMessagesRestriction);