From 8d1d8d845beb6bc6c99d90722169b77c3dff91e7 Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Fri, 30 Aug 2013 13:48:38 +0700 Subject: Messages --- src/com/juick/json/Message.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/com/juick/json/Message.java') 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) { -- cgit v1.2.3