aboutsummaryrefslogtreecommitdiff
path: root/src/com/juick/json/Message.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/juick/json/Message.java')
-rw-r--r--src/com/juick/json/Message.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/com/juick/json/Message.java b/src/com/juick/json/Message.java
index c1beebc4..18cc375e 100644
--- a/src/com/juick/json/Message.java
+++ b/src/com/juick/json/Message.java
@@ -83,6 +83,8 @@ public class Message {
}
if (msg.Timestamp != null) {
json.put("timestamp", msg.Timestamp);
+ } else if (msg.TimestampString != null) {
+ json.put("timestamp", msg.TimestampString);
}
if (msg.User != null) {
json.put("user", com.juick.json.User.toJSON(msg.User));
@@ -98,16 +100,16 @@ public class Message {
}
if (msg.AttachmentType != null) {
String fname = msg.MID + (msg.RID > 0 ? "-" + msg.RID : "") + "." + msg.AttachmentType;
- if (msg.AttachmentType.equals("jpg")) {
+ if (msg.AttachmentType.equals("mp4")) {
+ JSONObject video = new JSONObject();
+ video.put("mp4", "http://i.juick.com/video/" + fname);
+ json.put("video", video);
+ } else {
JSONObject photo = new JSONObject();
photo.put("thumbnail", "http://i.juick.com/ps/" + fname);
photo.put("small", "http://i.juick.com/photo-512/" + fname);
photo.put("medium", "http://i.juick.com/photo-1024/" + fname);
json.put("photo", photo);
- } else {
- JSONObject video = new JSONObject();
- video.put("mp4", "http://i.juick.com/video/" + fname);
- json.put("video", video);
}
}
} catch (JSONException e) {