From 92d35591464aaf05910fac53f72b5b223a08dc3c Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Mon, 19 Aug 2013 11:56:40 -0400 Subject: [PATCH] closes #176 --- src/posts.js | 4 ++-- src/topics.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/posts.js b/src/posts.js index 30902161ad..8282c8a3d7 100644 --- a/src/posts.js +++ b/src/posts.js @@ -213,8 +213,7 @@ var RDB = require('./redis.js'), Posts.create(uid, tid, content, images, function(postData) { if (postData) { - topics.addPostToTopic(tid, postData.pid); - + topics.markUnRead(tid); Posts.get_cid_by_pid(postData.pid, function(cid) { @@ -280,6 +279,7 @@ var RDB = require('./redis.js'), RDB.hmset('post:' + pid, postData); + topics.addPostToTopic(tid, pid); topics.increasePostCount(tid); topics.updateTimestamp(tid, timestamp); diff --git a/src/topics.js b/src/topics.js index fff4ee3ae4..29c435bde3 100644 --- a/src/topics.js +++ b/src/topics.js @@ -612,7 +612,6 @@ marked.setOptions({ posts.create(uid, tid, content, images, function(postData) { if (postData) { - RDB.lpush(schema.topics(tid).posts, postData.pid); // Auto-subscribe the post creator to the newly created topic threadTools.toggleFollow(tid, uid);