X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=375fc53abe883414aeec772479369352248e330c;hb=723a7eb494e3833334bd4800f7e3b3a7ba290d10;hp=a489c6041ee0d851ffb6e7ab5cb02f1ad5b2bda4;hpb=bf43e7c07d8f244f3415600ebb3d74765777b705;p=Sone.git diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index a489c60..375fc53 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -1235,6 +1235,9 @@ function loadNewPost(postId, soneId, recipientId, time) { } }); newPost = $(data.post.html).addClass("hidden"); + if ($(".post-author-local", newPost).text() == "true") { + newPost.removeClass("new"); + } if (firstOlderPost != null) { newPost.insertBefore(firstOlderPost); } @@ -1268,6 +1271,9 @@ function loadNewReply(replyId, soneId, postId, postSoneId) { } }); newReply = $(data.reply.html).addClass("hidden"); + if ($(".reply-author-local", newPost).text() == "true") { + newPost.removeClass("new"); + } if (firstNewerReply != null) { newReply.insertBefore(firstNewerReply); } else { @@ -1308,7 +1314,7 @@ function markSoneAsKnown(soneElement, skipRequest) { function markPostAsKnown(postElements, skipRequest) { $(postElements).each(function() { postElement = this; - if ($(postElement).hasClass("new")) { + if ($(postElement).hasClass("new") || ((typeof skipRequest != "undefined") && !skipRequest)) { (function(postElement) { $(postElement).removeClass("new"); if ((typeof skipRequest == "undefined") || !skipRequest) { @@ -1324,7 +1330,7 @@ function markPostAsKnown(postElements, skipRequest) { function markReplyAsKnown(replyElements, skipRequest) { $(replyElements).each(function() { replyElement = this; - if ($(replyElement).hasClass("new")) { + if ($(replyElement).hasClass("new") || ((typeof skipRequest != "undefined") && !skipRequest)) { (function(replyElement) { $(replyElement).removeClass("new"); if ((typeof skipRequest == "undefined") || !skipRequest) {