Skip to content

Node.js based forum software built for the modern web

fixed #776

Julian Lam442c543d2733
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);
}