diff options
author | Vitaly Takmazov | 2017-10-28 12:20:08 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-10-28 12:20:08 +0300 |
commit | 3ca4188155e5f04a5cc96c4be20ef206e9f3ffde (patch) | |
tree | eebecad654ef253411e91ea95edbebcf34eb0b39 | |
parent | be866aaf2be0ca2b3b5807b0583870bc06af6526 (diff) |
core: check attachment with xml compatibility
-rw-r--r-- | juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java | 13 |
1 files changed, 12 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 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(); } |