From 34d7d021e2ac9db1945ef09e309bdc5b188da4d3 Mon Sep 17 00:00:00 2001 From: Floens Date: Wed, 14 Feb 2018 16:15:31 +0100 Subject: [PATCH] quote post no when quoting from text selection and only quote the no if it has not already been quoted --- .../org/floens/chan/core/presenter/ReplyPresenter.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Clover/app/src/main/java/org/floens/chan/core/presenter/ReplyPresenter.java b/Clover/app/src/main/java/org/floens/chan/core/presenter/ReplyPresenter.java index 1d20e1de..28e8d427 100644 --- a/Clover/app/src/main/java/org/floens/chan/core/presenter/ReplyPresenter.java +++ b/Clover/app/src/main/java/org/floens/chan/core/presenter/ReplyPresenter.java @@ -306,7 +306,7 @@ public class ReplyPresenter implements AuthenticationLayoutCallback, ImagePickDe } public void quote(Post post, CharSequence text) { - handleQuote(null, text.toString()); + handleQuote(post, text.toString()); } private void handleQuote(Post post, String textQuote) { @@ -318,7 +318,12 @@ public class ReplyPresenter implements AuthenticationLayoutCallback, ImagePickDe extraNewline = "\n"; } - String postQuote = post != null ? ">>" + post.no + "\n" : ""; + String postQuote = ""; + if (post != null) { + if (!draft.comment.contains(">>" + post.no)) { + postQuote = ">>" + post.no + "\n"; + } + } StringBuilder textQuoteResult = new StringBuilder(); if (textQuote != null) {