jsonPost.put("id", post.getId());
jsonPost.put("sone", post.getSone().getId());
jsonPost.put("recipient", (post.getRecipient() != null) ? post.getRecipient().getId() : null);
+ jsonPost.put("time", post.getTime());
jsonPosts.add(jsonPost);
}
/* load new replies. */
});
/* process new posts. */
$.each(data.newPosts, function(index, value) {
- loadNewPost(value.id, value.sone, value.recipient);
+ loadNewPost(value.id, value.sone, value.recipient, value.time);
});
/* process new replies. */
$.each(data.newReplies, function(index, value) {
return $("#sone .reply#" + replyId).length > 0;
}
-function loadNewPost(postId, soneId, recipientId) {
+function loadNewPost(postId, soneId, recipientId, time) {
if (hasPost(postId)) {
return;
}
return;
}
}
+ if (getPostTime($("#sone .post").last()) > time) {
+ return;
+ }
}
$.getJSON("getPost.ajax", { "post" : postId }, function(data, textStatus) {
if ((data != null) && data.success) {