aboutsummaryrefslogtreecommitdiff
path: root/juick-core/src/main/java/com/juick/Message.java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-core/src/main/java/com/juick/Message.java')
-rw-r--r--juick-core/src/main/java/com/juick/Message.java33
1 files changed, 26 insertions, 7 deletions
diff --git a/juick-core/src/main/java/com/juick/Message.java b/juick-core/src/main/java/com/juick/Message.java
index b5fc2b89..d3f28e22 100644
--- a/juick-core/src/main/java/com/juick/Message.java
+++ b/juick-core/src/main/java/com/juick/Message.java
@@ -57,9 +57,9 @@ public class Message implements Comparable {
@XmlTransient
public int Replies = 0;
public String RepliesBy = null;
+ private String attachmentType;
@XmlTransient
- public String AttachmentType = null;
- public String Photo = null;
+ private Photo photo;
public String Video = null;
public Place Place = null;
@XmlTransient
@@ -87,8 +87,8 @@ public class Message implements Comparable {
ReadOnly = msg.ReadOnly;
Hidden = msg.Hidden;
Replies = msg.Replies;
- AttachmentType = msg.AttachmentType;
- Photo = msg.Photo;
+ attachmentType = msg.attachmentType;
+ photo = msg.photo;
Video = msg.Video;
Place = msg.Place;
Likes = msg.Likes;
@@ -157,15 +157,16 @@ public class Message implements Comparable {
}
}
+ @JsonIgnore
public String getAttachmentURL() {
- if (AttachmentType != null) {
+ if (attachmentType != null) {
String url = "http://i.juick.com/";
- url += AttachmentType.equals("mp4") ? "video" : "photos-1024";
+ url += attachmentType.equals("mp4") ? "video" : "photos-1024";
url += "/" + getMid();
if (getRid() > 0) {
url += "-" + getRid();
}
- url += "." + AttachmentType;
+ url += "." + attachmentType;
return url;
} else {
return null;
@@ -309,4 +310,22 @@ public class Message implements Comparable {
public void setPrivacy(int privacy) {
this.privacy = privacy;
}
+
+ public Photo getPhoto() {
+ return photo;
+ }
+
+ public void setPhoto(Photo photo) {
+ this.photo = photo;
+ }
+
+ @XmlAttribute(name = "attach")
+ @JsonProperty("attach")
+ public String getAttachmentType() {
+ return attachmentType;
+ }
+
+ public void setAttachmentType(String attachmentType) {
+ this.attachmentType = attachmentType;
+ }
}