From e7b9b953715933a9444023f9e9c3cb85ce5ab2ef Mon Sep 17 00:00:00 2001 From: NekoInverter Date: Wed, 8 Dec 2021 21:45:31 +0800 Subject: [PATCH] Fix cannot delete messages that send as channel (official bug) --- .../src/main/java/org/telegram/messenger/MessageObject.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessageObject.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessageObject.java index 46991d2fe..9ca0e1c70 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessageObject.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessageObject.java @@ -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); }