diff --git a/4chan_x.user.js b/4chan_x.user.js index caff32559..3de86d8a5 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -4981,7 +4981,6 @@ Unread.lastReadPost = $.get("lastReadPosts." + this.board, { threads: {} }).threads[this] || 0; - Unread.yourPosts = []; Unread.posts = []; Unread.title = d.title; posts = []; @@ -4994,15 +4993,17 @@ } Unread.addPosts(posts); $.on(d, 'ThreadUpdate', Unread.onUpdate); - $.on(d, 'QRPostSuccessful', Unread.post); return $.on(d, 'scroll visibilitychange', Unread.read); }, addPosts: function(newPosts) { - var ID, post, _i, _len; + var ID, post, yourPosts, _i, _len; + if (Conf['Quick Reply']) { + yourPosts = QR.yourPosts.threads[Unread.thread]; + } for (_i = 0, _len = newPosts.length; _i < _len; _i++) { post = newPosts[_i]; ID = post.ID; - if (!(ID <= Unread.lastReadPost || post.isHidden || __indexOf.call(Unread.yourPosts, ID) >= 0)) { + if (!(ID <= Unread.lastReadPost || post.isHidden || yourPosts && __indexOf.call(yourPosts, ID) >= 0)) { Unread.posts.push(post); } } @@ -5016,9 +5017,6 @@ return Unread.addPosts(e.detail.newPosts); } }, - post: function(e) { - return Unread.yourPosts.push(e.detail.postID); - }, read: function(e) { var bottom, height, i, post, _i, _len, _ref; if (d.hidden || !Unread.posts.length) { diff --git a/src/features.coffee b/src/features.coffee index d5a75e8ce..447b7536d 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -3310,7 +3310,6 @@ Unread = node: -> Unread.thread = @ Unread.lastReadPost = $.get("lastReadPosts.#{@board}", threads: {}).threads[@] or 0 - Unread.yourPosts = [] Unread.posts = [] Unread.title = d.title posts = [] @@ -3318,13 +3317,14 @@ Unread = posts.push post if post.isReply Unread.addPosts posts $.on d, 'ThreadUpdate', Unread.onUpdate - $.on d, 'QRPostSuccessful', Unread.post $.on d, 'scroll visibilitychange', Unread.read addPosts: (newPosts) -> + if Conf['Quick Reply'] + yourPosts = QR.yourPosts.threads[Unread.thread] for post in newPosts {ID} = post - unless ID <= Unread.lastReadPost or post.isHidden or ID in Unread.yourPosts + unless ID <= Unread.lastReadPost or post.isHidden or yourPosts and ID in yourPosts Unread.posts.push post Unread.read() Unread.update() @@ -3335,9 +3335,6 @@ Unread = else Unread.addPosts e.detail.newPosts - post: (e) -> - Unread.yourPosts.push e.detail.postID - read: (e) -> return if d.hidden or !Unread.posts.length height = doc.clientHeight