Skip to content

Commit

Permalink
fix: DoubleTapAction Show Reactions
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Dec 5, 2023
1 parent aecb41e commit f7f1f6b
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit f7f1f6b

Please sign in to comment.