Only mark items as known if the notification is still enabled when it disappears.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 11 Nov 2011 10:28:35 +0000 (11:28 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 11 Nov 2011 10:28:35 +0000 (11:28 +0100)
src/main/resources/static/javascript/sone.js

index bbd039c..b819333 100644 (file)
@@ -1193,17 +1193,17 @@ function getStatus() {
                                        }
                                });
                                if (!foundNotification) {
                                        }
                                });
                                if (!foundNotification) {
-                                       if (notificationId == "new-sone-notification") {
+                                       if (notificationId == "new-sone-notification" && (data.options["ShowNotification/NewSones"] == true)) {
                                                $(".new-sone-id", this).each(function(index, element) {
                                                        soneId = $(this).text();
                                                        markSoneAsKnown(getSone(soneId), true);
                                                });
                                                $(".new-sone-id", this).each(function(index, element) {
                                                        soneId = $(this).text();
                                                        markSoneAsKnown(getSone(soneId), true);
                                                });
-                                       } else if (notificationId == "new-post-notification") {
+                                       } else if (notificationId == "new-post-notification" && (data.options["ShowNotification/NewPosts"] == true)) {
                                                $(".post-id", this).each(function(index, element) {
                                                        postId = $(this).text();
                                                        markPostAsKnown(getPost(postId), true);
                                                });
                                                $(".post-id", this).each(function(index, element) {
                                                        postId = $(this).text();
                                                        markPostAsKnown(getPost(postId), true);
                                                });
-                                       } else if (notificationId == "new-reply-notification") {
+                                       } else if (notificationId == "new-reply-notification" && (data.options["ShowNotification/NewReplies"] == true)) {
                                                $(".reply-id", this).each(function(index, element) {
                                                        replyId = $(this).text();
                                                        markReplyAsKnown(getReply(replyId), true);
                                                $(".reply-id", this).each(function(index, element) {
                                                        replyId = $(this).text();
                                                        markReplyAsKnown(getReply(replyId), true);