コード例 #1
0
 private void parsePointAPIMessage(JSONObject post, PointMessage msg)
     throws JSONException, ParseException {
   JSONObject p = post.getJSONObject("post");
   parsePointAPIMessagePost(msg, p);
   PointMessageID mid = (PointMessageID) msg.getMID();
   mid.uid = post.getInt("uid");
   msg.source = post.toString();
   msg.subscribed = post.getBoolean("subscribed");
 }
コード例 #2
0
 private void parsePointAPIComment(JSONObject comm, PointMessage msg, PointMessage parent)
     throws JSONException, ParseException {
   PointUser pu = new PointUser();
   msg.User = pu;
   JSONObject author = comm.getJSONObject("author");
   pu.UName = author.getString("login");
   pu.FullName = author.getString("name");
   pu.UID = author.getInt("id");
   if (author.has("avatar") && author.get("avatar") != JSONObject.NULL) {
     pu.avatarUrl = author.getString("avatar");
   }
   msg.Text = comm.getString("text");
   msg.is_rec = comm.getBoolean("is_rec");
   msg.Timestamp = parsePointAPIDate(comm.getString("created"));
   msg.setMID(parent.getMID());
   msg.setRID(comm.getInt("id"));
   Object toCommentId = comm.get("to_comment_id");
   if (toCommentId != JSONObject.NULL) {
     msg.setReplyTo(comm.getInt("to_comment_id"));
   }
   msg.microBlogCode = PointMessageID.CODE;
 }