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; }