From 442c543d27334713e16ec2ed13fcd4b30eb25d1d Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 14 Jan 2014 17:02:54 -0500 Subject: [PATCH] fixed #776 --- public/src/forum/unread.js | 3 ++- src/socket.io/topics.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/public/src/forum/unread.js b/public/src/forum/unread.js index 5151eb37cb..3abafa1521 100644 --- a/public/src/forum/unread.js +++ b/public/src/forum/unread.js @@ -7,7 +7,8 @@ define(function() { ajaxify.register_events([ 'event:new_topic', - 'event:new_post' + 'event:new_post', + 'api:topics.markAllRead' ]); var newTopicCount = 0, diff --git a/src/socket.io/topics.js b/src/socket.io/topics.js index c597fc88db..43e8b8e127 100644 --- a/src/socket.io/topics.js +++ b/src/socket.io/topics.js @@ -72,6 +72,7 @@ SocketTopics.markAllRead = function(data, callback, sessionData) { topics.markAllRead(sessionData.uid, function(err, success) { if (!err && success) { callback(true); + sessionData.server.sockets.in('uid_' + sessionData.uid).emit('event:unread.updateCount', 0); } else { callback(false); }