From fabdccb6f9da49058a72ce69674ffcfe51f53002 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 19 Oct 2016 15:56:01 +0300 Subject: protocol: fix reply quote --- .../main/java/com/juick/formatters/PlainTextFormatter.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'juick-core/src/main/java/com/juick/formatters') diff --git a/juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java b/juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java index 37b0c6d3..6c712d28 100644 --- a/juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java +++ b/juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java @@ -10,7 +10,7 @@ public class PlainTextFormatter { StringBuilder sb = new StringBuilder(); boolean isReply = jmsg.getRID() > 0; String title = isReply ? "Reply by @" : "@"; - String subtitle = isReply ? getReplyQuote(jmsg) : jmsg.getTagsString(); + String subtitle = isReply ? jmsg.getReplyQuote() : jmsg.getTagsString(); sb.append(title).append(jmsg.getUser().getUName()).append(":\n") .append(subtitle).append("\n").append(jmsg.getText()).append("\n"); if (jmsg.Photo != null) { @@ -25,14 +25,4 @@ public class PlainTextFormatter { } return "https://juick.com/" + jmsg.getMID(); } - - private static String getReplyQuote(Message msg) { - String quote = msg.getText(); - if (quote.length() > 50) { - quote = ">" + quote.substring(0, 47).replace('\n', ' ') + "...\n"; - } else if (quote.length() > 0) { - quote = ">" + quote.replace('\n', ' ') + "\n"; - } - return quote; - } } -- cgit v1.2.3