From f7f1f6b02427788be7dd0df6d6aa48616d962ff7 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Tue, 5 Dec 2023 22:36:29 +0800 Subject: [PATCH] fix: DoubleTapAction Show Reactions --- .../java/org/telegram/ui/ChatActivity.java | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index d0044d2d58..15337779c2 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -1742,31 +1742,13 @@ public void onDoubleTap(View view, int position, float x, float y) { if (NaConfig.INSTANCE.getDoubleTapAction().Int() == DoubleTap.DOUBLE_TAP_ACTION_NONE || !(view instanceof ChatMessageCell) || getParentActivity() == null || isSecretChat() || isInScheduleMode() || isInPreviewMode()) { return; } - if (NaConfig.INSTANCE.getDoubleTapAction().Int() == DoubleTap.DOUBLE_TAP_ACTION_SHOW_REACTIONS) { - ChatMessageCell cell = (ChatMessageCell) view; - MessageObject primaryMessage = cell.getPrimaryMessageObject(); - if (primaryMessage.isSecretMedia() || primaryMessage.isExpiredStory() || primaryMessage.type == MessageObject.TYPE_JOINED_CHANNEL) { - return; - } - ReactionsEffectOverlay.removeCurrent(false); - String reactionString = getMediaDataController().getDoubleTapReaction(); - if (reactionString.startsWith("animated_")) { - boolean available = dialog_id >= 0; - if (!available && chatInfo != null) { - available = ChatObject.reactionIsAvailable(chatInfo, reactionString); - } - if (!available) { - return; - } - createMenu(view, true, false, x, y, true, true); - } - } else if (NaConfig.INSTANCE.getDoubleTapAction().Int() == DoubleTap.DOUBLE_TAP_ACTION_SEND_REACTIONS) { + if (NaConfig.INSTANCE.getDoubleTapAction().Int() == DoubleTap.DOUBLE_TAP_ACTION_SEND_REACTIONS) { if (isSecretChat() || isInScheduleMode()) { return; } ChatMessageCell cell = (ChatMessageCell) view; MessageObject primaryMessage = cell.getPrimaryMessageObject(); - if (primaryMessage.isSecretMedia()) { + if (primaryMessage.isSecretMedia() || primaryMessage.isExpiredStory() || primaryMessage.type == MessageObject.TYPE_JOINED_CHANNEL) { return; } ReactionsEffectOverlay.removeCurrent(false); @@ -1794,6 +1776,8 @@ public void onDoubleTap(View view, int position, float x, float y) { } selectReaction(primaryMessage, null, null, x, y, ReactionsLayoutInBubble.VisibleReaction.fromEmojicon(reaction), true, false, false); } + } else if (NaConfig.INSTANCE.getDoubleTapAction().Int() == DoubleTap.DOUBLE_TAP_ACTION_SHOW_REACTIONS) { + createMenu(view, true, false, x, y, true, true); } else { var cell = (ChatMessageCell) view; var message = cell.getMessageObject();