From 785b18cb412d067f407b474b4098cdb9bb1773a1 Mon Sep 17 00:00:00 2001 From: Andy Klimczak Date: Sun, 6 Aug 2017 20:12:18 -0400 Subject: [PATCH] Do not include >>post no from quoted posts, when quoting with text --- .../java/org/floens/chan/core/presenter/ReplyPresenter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 e41f297b..0259e4de 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 @@ -280,8 +280,11 @@ public class ReplyPresenter implements ReplyManager.HttpCallback, if (withText) { String[] lines = post.comment.toString().split("\n+"); + final Pattern quotePattern = Pattern.compile("^>>\\d+(\\s\\(OP\\))?$"); // matches for >>123 or >>123 (OP) for (String line : lines) { - textToInsert += ">" + line + "\n"; + if(!quotePattern.matcher(line).matches()) { // do not include post no from quoted post + textToInsert += ">" + line + "\n"; + } } }