aboutsummaryrefslogtreecommitdiff
path: root/juick-core/src
diff options
context:
space:
mode:
Diffstat (limited to 'juick-core/src')
-rw-r--r--juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java2
-rw-r--r--juick-core/src/main/java/com/juick/util/MessageUtils.java4
2 files changed, 5 insertions, 1 deletions
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 4e95e6c2..c599d33b 100644
--- a/juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java
+++ b/juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java
@@ -42,7 +42,7 @@ public class PlainTextFormatter {
String subtitle = isReply ? markdown ? MessageUtils.escapeMarkdown(StringUtils.defaultString(jmsg.getReplyQuote()))
: jmsg.getReplyQuote()
: markdown ? MessageUtils.getMarkdownTags(jmsg) : MessageUtils.getTagsString(jmsg);
- sb.append(title).append(markdown ? String.format("[%s](https://juick.com/%s/)", jmsg.getUser().getName(), jmsg.getUser().getName()) : jmsg.getUser().getName()).append(":\n")
+ sb.append(title).append(markdown ? MessageUtils.getMarkdownUser(jmsg) : jmsg.getUser().getName()).append(":\n")
.append(subtitle).append("\n");
if (markdown) {
sb.append(MessageUtils.escapeMarkdown(StringUtils.defaultString(jmsg.getText())));
diff --git a/juick-core/src/main/java/com/juick/util/MessageUtils.java b/juick-core/src/main/java/com/juick/util/MessageUtils.java
index ce9415ea..87a10351 100644
--- a/juick-core/src/main/java/com/juick/util/MessageUtils.java
+++ b/juick-core/src/main/java/com/juick/util/MessageUtils.java
@@ -188,6 +188,10 @@ public class MessageUtils {
.collect(Collectors.joining(", "));
}
+ public static String getMarkdownUser(final Message jmsg) {
+ return String.format("[%s](https://juick.com/%s/)", jmsg.getUser().getName(), jmsg.getUser().getName());
+ }
+
// TODO: check if it is really needed
public static String percentEncode(final String s) {
String ret = StringUtils.EMPTY;