diff --git a/public/src/forum/footer.js b/public/src/forum/footer.js index c983e0a834..94c07caef8 100644 --- a/public/src/forum/footer.js +++ b/public/src/forum/footer.js @@ -25,20 +25,11 @@ define('forum/footer', ['notifications', 'chat'], function(Notifications, Chat) } function onNewPost(data) { - if (data && data.posts && data.posts.length) { - var post = data.posts[0]; - if (parseInt(post.uid, 10) !== parseInt(app.uid, 10)) { - increaseUnreadCount(); - } + if (parseInt(app.uid, 10)) { + socket.emit('user.getUnreadCount', updateUnreadTopicCount); } } - function increaseUnreadCount() { - var count = parseInt($('#unread-count').attr('data-content'), 10) + 1; - updateUnreadTopicCount(null, count); - } - - socket.on('event:new_post', onNewPost); socket.on('event:unread.updateCount', updateUnreadTopicCount);