From a0529a4e1e79734e41e3bbbf630d7460fea24286 Mon Sep 17 00:00:00 2001 From: Millesimus Date: Sun, 22 Aug 2021 08:56:32 +0200 Subject: [PATCH] On quoting, translate French quotes to XEP-0393 quotes. --- .../java/eu/siacs/conversations/ui/widget/EditMessage.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/widget/EditMessage.java b/src/main/java/eu/siacs/conversations/ui/widget/EditMessage.java index a4c6e67fd..3471ffcfa 100644 --- a/src/main/java/eu/siacs/conversations/ui/widget/EditMessage.java +++ b/src/main/java/eu/siacs/conversations/ui/widget/EditMessage.java @@ -24,6 +24,7 @@ import java.util.concurrent.Executors; import eu.siacs.conversations.Config; import eu.siacs.conversations.R; +import eu.siacs.conversations.ui.util.QuoteHelper; public class EditMessage extends EmojiWrapperEditText { @@ -142,7 +143,8 @@ public class EditMessage extends EmojiWrapperEditText { } public void insertAsQuote(String text) { - text = text.replaceAll("(\n *){2,}", "\n").replaceAll("(^|\n)>", "$1>>").replaceAll("(^|\n)([^>])", "$1> $2").replaceAll("\n$", ""); + text = QuoteHelper.replaceAltQuoteCharsInText(text); + text = text.replaceAll("(\n *){2,}", "\n").replaceAll("(^|\n)(" + QuoteHelper.QUOTE_CHAR + ")", "$1$2$2").replaceAll("(^|\n)([^>" + QuoteHelper.QUOTE_CHAR + "])", "$1> $2").replaceAll("\n$", ""); Editable editable = getEditableText(); int position = getSelectionEnd(); if (position == -1) position = editable.length();