aboutsummaryrefslogtreecommitdiff
path: root/src/com/juick/json/Message.java
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2013-08-30 13:48:38 +0700
committerGravatar Ugnich Anton2013-08-30 13:48:38 +0700
commit8d1d8d845beb6bc6c99d90722169b77c3dff91e7 (patch)
treedce92d1d27f94c2c86f130223dcac52763c9e7cc /src/com/juick/json/Message.java
parent40fe707e6566faa02eeba2e8f4830dbbd3992f4a (diff)
Messages
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) {