fix post quote for null extra texts.

refactor-toolbar
Floens 8 years ago
parent 4a9b0b42bc
commit fbe777d0cd
  1. 2
      Clover/app/src/main/java/org/floens/chan/core/presenter/ReplyPresenter.java

@ -299,6 +299,7 @@ public class ReplyPresenter implements AuthenticationLayoutCallback, ImagePickDe
String postQuote = post != null ? ">>" + post.no + "\n" : ""; String postQuote = post != null ? ">>" + post.no + "\n" : "";
StringBuilder textQuoteResult = new StringBuilder(); StringBuilder textQuoteResult = new StringBuilder();
if (textQuote != null) {
String[] lines = textQuote.split("\n+"); String[] lines = textQuote.split("\n+");
// matches for >>123, >>123 (OP), >>123 (You), >>>/fit/123 // matches for >>123, >>123 (OP), >>123 (You), >>>/fit/123
final Pattern quotePattern = Pattern.compile("^>>(>/[a-z0-9]+/)?\\d+.*$"); final Pattern quotePattern = Pattern.compile("^>>(>/[a-z0-9]+/)?\\d+.*$");
@ -308,6 +309,7 @@ public class ReplyPresenter implements AuthenticationLayoutCallback, ImagePickDe
textQuoteResult.append(">").append(line).append("\n"); textQuoteResult.append(">").append(line).append("\n");
} }
} }
}
commentInsert(extraNewline + postQuote + textQuoteResult.toString()); commentInsert(extraNewline + postQuote + textQuoteResult.toString());

Loading…
Cancel
Save