aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/juick/json/Message.java29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/com/juick/json/Message.java b/src/com/juick/json/Message.java
index c765a5d8..4ab1901a 100644
--- a/src/com/juick/json/Message.java
+++ b/src/com/juick/json/Message.java
@@ -40,6 +40,10 @@ public class Message {
if (json.has("replyto")) {
jmsg.ReplyTo = json.getInt("replyto");
}
+
+ jmsg.FriendsOnly = json.has("friendsonly");
+ jmsg.ReadOnly = json.has("readonly");
+
jmsg.Text = json.getString("body").replace(""", "\"");
jmsg.User = com.juick.json.User.parseJSON(json.getJSONObject("user"));
@@ -64,9 +68,6 @@ public class Message {
if (json.has("photo")) {
jmsg.Photo = json.getJSONObject("photo").getString("small");
}
- if (json.has("video")) {
- jmsg.Video = json.getJSONObject("video").getString("mp4");
- }
return jmsg;
}
@@ -84,6 +85,12 @@ public class Message {
if (msg.ReplyTo > 0) {
json.put("replyto", msg.ReplyTo);
}
+ if (msg.FriendsOnly) {
+ json.put("friendsonly", 1);
+ }
+ if (msg.ReadOnly) {
+ json.put("readonly", 1);
+ }
if (msg.Text != null) {
json.put("body", msg.Text);
}
@@ -106,17 +113,11 @@ public class Message {
}
if (msg.AttachmentType != null) {
String fname = msg.MID + (msg.RID > 0 ? "-" + msg.RID : "") + "." + msg.AttachmentType;
- 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/photos-512/" + fname);
- photo.put("medium", "http://i.juick.com/photos-1024/" + fname);
- json.put("photo", photo);
- }
+ JSONObject photo = new JSONObject();
+ photo.put("thumbnail", "http://i.juick.com/ps/" + fname);
+ photo.put("small", "http://i.juick.com/photos-512/" + fname);
+ photo.put("medium", "http://i.juick.com/photos-1024/" + fname);
+ json.put("photo", photo);
}
} catch (JSONException e) {
}