From 3ca4188155e5f04a5cc96c4be20ef206e9f3ffde Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 28 Oct 2017 12:20:08 +0300 Subject: core: check attachment with xml compatibility --- .../main/java/com/juick/formatters/PlainTextFormatter.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'juick-core/src/main/java') 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 40eb6939..bd4cfedb 100644 --- a/juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java +++ b/juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java @@ -39,7 +39,18 @@ public class PlainTextFormatter { sb.append(title).append(jmsg.getUser().getName()).append(":\n") .append(subtitle).append("\n").append(jmsg.getText()).append("\n"); if (StringUtils.isNotEmpty(jmsg.getAttachmentType())) { - sb.append(jmsg.getAttachment().getMedium().getUrl()); + // FIXME: attachment does not serialized to xml + if (jmsg.getAttachment() == null) { + if (jmsg.getRid() > 0) { + sb.append(String.format("http://i.juick.com/photos-1024/%d-%d.%s", jmsg.getMid(), + jmsg.getRid(), jmsg.getAttachmentType())); + } else { + sb.append(String.format("http://i.juick.com/photos-1024/%d.%s", jmsg.getMid(), + jmsg.getAttachmentType())); + } + } else { + sb.append(jmsg.getAttachment().getMedium().getUrl()); + } } return sb.toString(); } -- cgit v1.2.3