Show posts mentioning a local Sone by a new notification.
[Sone.git] / src / main / resources / static / javascript / sone.js
index 375fc53..0cc6480 100644 (file)
@@ -1237,6 +1237,11 @@ function loadNewPost(postId, soneId, recipientId, time) {
                        newPost = $(data.post.html).addClass("hidden");
                        if ($(".post-author-local", newPost).text() == "true") {
                                newPost.removeClass("new");
+                               (function(newPost) {
+                                       setTimeout(function() {
+                                               markPostAsKnown(newPost, false);
+                                       }, 5000);
+                               })(newPost);
                        }
                        if (firstOlderPost != null) {
                                newPost.insertBefore(firstOlderPost);
@@ -1271,8 +1276,13 @@ function loadNewReply(replyId, soneId, postId, postSoneId) {
                                        }
                                });
                                newReply = $(data.reply.html).addClass("hidden");
-                               if ($(".reply-author-local", newPost).text() == "true") {
-                                       newPost.removeClass("new");
+                               if ($(".reply-author-local", newReply).text() == "true") {
+                                       newReply.removeClass("new");
+                                       (function(newReply) {
+                                               setTimeout(function() {
+                                                       markReplyAsKnown(newReply, false);
+                                               }, 5000);
+                                       })(newReply);
                                }
                                if (firstNewerReply != null) {
                                        newReply.insertBefore(firstNewerReply);