From 350b36a2d6a344039152e92e908bc0a26a09d476 Mon Sep 17 00:00:00 2001 From: kosyak Date: Wed, 22 May 2024 09:56:57 +0200 Subject: [PATCH] revert reply fallback handling fix --- .../eu/siacs/conversations/entities/Message.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java index 9b4be3e0d..80201ba20 100644 --- a/src/main/java/eu/siacs/conversations/entities/Message.java +++ b/src/main/java/eu/siacs/conversations/entities/Message.java @@ -880,18 +880,14 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable return sb; } - if (replyMessage != null && replyMessage.edits.isEmpty()) { - sb.replace(0, replyMessage.body.codePointCount(0, replyMessage.body.length()) + 3, ""); - } else { - Element bodyFallback = replyFallback.get(0).findChild("body"); - int startCodePoint = Integer.parseInt(bodyFallback.getAttribute("start")); - int endCodePoint = Integer.parseInt(bodyFallback.getAttribute("end")); + Element bodyFallback = replyFallback.get(0).findChild("body"); + int startCodePoint = Integer.parseInt(bodyFallback.getAttribute("start")); + int endCodePoint = Integer.parseInt(bodyFallback.getAttribute("end")); - if (startCodePoint < 0) return sb; - if (endCodePoint > sb.length()) return sb; + if (startCodePoint < 0) return sb; + if (endCodePoint > sb.length()) return sb; - sb.replace(message.body.offsetByCodePoints(0, startCodePoint), message.body.offsetByCodePoints(0, endCodePoint), ""); - } + sb.replace(message.body.offsetByCodePoints(0, startCodePoint), message.body.offsetByCodePoints(0, endCodePoint), ""); return sb; }