Fix cannot delete messages that send as channel (official bug)

This commit is contained in:
NekoInverter 2021-12-08 21:45:31 +08:00 committed by arm64v8a
parent 9424f76de0
commit e7b9b95371

View File

@ -5881,7 +5881,7 @@ public class MessageObject {
if (message.out && message instanceof TLRPC.TL_messageService) {
return message.id != 1 && ChatObject.canUserDoAdminAction(chat, ChatObject.ACTION_DELETE_MESSAGES);
}
return inScheduleMode || message.id != 1 && (chat.creator || chat.admin_rights != null && (chat.admin_rights.delete_messages || message.out && (chat.megagroup || chat.admin_rights.post_messages)) || chat.megagroup && message.out && message.from_id instanceof TLRPC.TL_peerUser);
return inScheduleMode || message.id != 1 && (chat.creator || chat.admin_rights != null && (chat.admin_rights.delete_messages || message.out && (chat.megagroup || chat.admin_rights.post_messages)) || chat.megagroup && message.out && (message.from_id instanceof TLRPC.TL_peerUser || message.from_id instanceof TLRPC.TL_peerChannel));
}
return inScheduleMode || isOut(message) || !ChatObject.isChannel(chat);
}