From 9a999ba2cc7bed3f636ed5b9ae3dc9705dba256d Mon Sep 17 00:00:00 2001 From: jeena Date: Sun, 21 Apr 2013 12:21:29 +0200 Subject: [PATCH] fixed problem with unread mentions and reposts --- WebKit/scripts/controller/Mentions.js | 35 ++++++++++++++++----------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/WebKit/scripts/controller/Mentions.js b/WebKit/scripts/controller/Mentions.js index 326cadf..a0cc51c 100644 --- a/WebKit/scripts/controller/Mentions.js +++ b/WebKit/scripts/controller/Mentions.js @@ -83,25 +83,32 @@ function(HostApp, Timeline, URI, Paths, Core) { Mentions.prototype.updateLatestMentionRead = function() { - var status = this.body.firstChild.status; + for (var i = 0; i < this.body.childNodes.length; i++) { - if (status && status.type == "https://tent.io/types/post/status/v0.1.0") { + var status = this.body.childNodes[i].status; - var url = URI(Paths.mkApiRootPath("/profile/" + encodeURIComponent("https://tent.io/types/info/cursor/v0.1.0"))); - var body = { - "mentions": { - "https://tent.io/types/post/status/v0.1.0": { - "post": status.id, - "entity": status.entity + if (!status.__repost) { + if (status && status.type == "https://tent.io/types/post/status/v0.1.0") { + + var url = URI(Paths.mkApiRootPath("/profile/" + encodeURIComponent("https://tent.io/types/info/cursor/v0.1.0"))); + var body = { + "mentions": { + "https://tent.io/types/post/status/v0.1.0": { + "post": status.id, + "entity": status.entity + } + } } + + var callback = function(resp) { + + } + + Paths.getURL(url.toString(), "PUT", callback, JSON.stringify(body)); } + + break; } - - var callback = function(resp) { - - } - - Paths.getURL(url.toString(), "PUT", callback, JSON.stringify(body)); } }