diff options
Diffstat (limited to 'juick-core/src/main')
-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(); } |