Skip to content

Node.js based forum software built for the modern web

updating post and topic methods so that when you reply to a post or create a new topic, that topic isn't flagged as unread for you

Julian Lam71482163ed1a
diff --git a/src/posts.js b/src/posts.js
index 1a9eedacfc..e14f67e889 100644
--- a/src/posts.js
+++ b/src/posts.js
@@ -168,6 +168,9 @@ marked.setOptions({
RDB.del('tid:' + tid + ':read_by_uid'); // let everybody know there is an unread post
+ // Re-add the poster, so he/she does not get an "unread" flag on this topic
+ topics.markAsRead(tid, uid);
+
socket.emit('event:alert', {
title: 'Reply Successful',
message: 'You have successfully replied. Click here to view your reply.',
diff --git a/src/topics.js b/src/topics.js
index 69f79e7d83..ead41792d1 100644
--- a/src/topics.js
+++ b/src/topics.js
@@ -215,6 +215,7 @@ var RDB = require('./redis.js'),
if (pid > 0) RDB.lpush('tid:' + tid + ':posts', pid);
});
+ Topics.markAsRead(tid, uid);
// User Details - move this out later
RDB.lpush('uid:' + uid + ':topics', tid);