X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=cd34ed28259407e98acbb0c4d57db90c1d67a8b3;hp=a3e79cd888840e771d827967b5e56d445145e8e8;hb=c731d14a20122ba8c02db2381305e821ad367712;hpb=68f60579b7f25d7768c1cbb7a60ebb40f306639a diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index a3e79cd..cd34ed2 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -585,7 +585,7 @@ function getStatus() { }); /* 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) { @@ -706,7 +706,7 @@ function hasReply(replyId) { return $("#sone .reply#" + replyId).length > 0; } -function loadNewPost(postId, soneId, recipientId) { +function loadNewPost(postId, soneId, recipientId, time) { if (hasPost(postId)) { return; } @@ -716,6 +716,9 @@ function loadNewPost(postId, soneId, recipientId) { return; } } + if (getPostTime($("#sone .post").last()) > time) { + return; + } } $.getJSON("getPost.ajax", { "post" : postId }, function(data, textStatus) { if ((data != null) && data.success) {