From e882914b29f384d3f530865737cc7de3790e5b0e Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 6 Oct 2018 23:39:10 +0300 Subject: HTML replies --- juick-server/src/main/java/com/juick/server/ActivityPubManager.java | 2 +- juick-server/src/main/java/com/juick/server/EmailManager.java | 2 +- juick-server/src/main/java/com/juick/server/api/rss/RepliesView.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'juick-server/src/main/java/com/juick/server') diff --git a/juick-server/src/main/java/com/juick/server/ActivityPubManager.java b/juick-server/src/main/java/com/juick/server/ActivityPubManager.java index 4adfafea..c1790deb 100644 --- a/juick-server/src/main/java/com/juick/server/ActivityPubManager.java +++ b/juick-server/src/main/java/com/juick/server/ActivityPubManager.java @@ -196,7 +196,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene note.setCc(Collections.singletonList(followersUri(msg.getUser()))); } note.setPublished(msg.getTimestamp()); - note.setContent(MessageUtils.formatMessage(msg.getText())); + note.setContent(msg.isHtml() ? msg.getText() : MessageUtils.formatMessage(msg.getText())); if (StringUtils.isNotBlank(msg.getAttachmentType())) { Image attachment = new Image(); attachment.setId(msg.getAttachment().getMedium().getUrl()); diff --git a/juick-server/src/main/java/com/juick/server/EmailManager.java b/juick-server/src/main/java/com/juick/server/EmailManager.java index 726da4b9..1cdafac6 100644 --- a/juick-server/src/main/java/com/juick/server/EmailManager.java +++ b/juick-server/src/main/java/com/juick/server/EmailManager.java @@ -114,7 +114,7 @@ public class EmailManager implements NotificationListener { String htmlText = String.format("%s

--
You are receiving this because you are subscribed to this user" + ", discussion, tag or mentioned. Reply to this email directly or view it on Juick." + "
Configure or disable notifications", - MessageUtils.formatHtml(msg), formatUrl(msg), + msg.isHtml() ? msg.getText() : MessageUtils.formatHtml(msg), formatUrl(msg), msg.getMid(), msg.getRid(), hash, hash); sendEmail(email, subject, plainText, htmlText, headers); } diff --git a/juick-server/src/main/java/com/juick/server/api/rss/RepliesView.java b/juick-server/src/main/java/com/juick/server/api/rss/RepliesView.java index f9d7109e..a0ab801e 100644 --- a/juick-server/src/main/java/com/juick/server/api/rss/RepliesView.java +++ b/juick-server/src/main/java/com/juick/server/api/rss/RepliesView.java @@ -78,7 +78,7 @@ public class RepliesView extends AbstractRssFeedView { Item item = new Item(); String messageUrl = String.format("http://juick.com/m/%d#%d", msg.getMid(), msg.getRid()); String messageTitle = String.format("@%s:", msg.getUname()); - String messageDescription = MessageUtils.formatMessage(msg.getDescription()); + String messageDescription = msg.isHtml() ? msg.getDescription() : MessageUtils.formatMessage(msg.getDescription()); item.setLink(messageUrl); //item.setGuid(messageUrl); item.setTitle(messageTitle); -- cgit v1.2.3