From a06e17f176e4a85dbac4d1396216948ff8ea5d06 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sat, 26 Oct 2024 11:32:17 +0800 Subject: [PATCH] fix: Quick Toggle Anonymous in channel --- .../java/org/telegram/ui/Components/ChatActivityEnterView.java | 2 +- .../main/java/org/telegram/ui/Components/SenderSelectPopup.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java index d9e8e66f41..9fc60c7763 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java @@ -3737,7 +3737,7 @@ private void createSenderSelectView() { if (chatFull != null) { var chat = controller.getChat(chatFull.id); - if (chat != null && chat.creator) { + if (chat != null && ChatObject.isMegagroup(chat) && chat.creator) { var self = UserConfig.getInstance(currentAccount).getCurrentUser(); if (peer.channel_id == chat.id) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/SenderSelectPopup.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/SenderSelectPopup.java index 9fd1c8eeb6..e4cff96000 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/SenderSelectPopup.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/SenderSelectPopup.java @@ -148,7 +148,7 @@ protected int getSuggestedMinimumWidth() { if (NaConfig.INSTANCE.getQuickToggleAnonymous().Bool()) { var chat = messagesController.getChat(chatFull.id); - if (chat != null && chat.creator) { + if (chat != null && ChatObject.isMegagroup(chat) && chat.creator) { if (peers.stream().noneMatch(peer -> peer.peer.channel_id == chat.id)) { peers.add(peers.size() >= 1 ? 1 : 0, new TLRPC.TL_sendAsPeer() {{ peer = new TLRPC.TL_peerChannel() {{ channel_id = chat.id; }};