Skip to content

Node.js based forum software built for the modern web

closes #97

Baris Soner Usakli285e19fbbfcc
diff --git a/src/postTools.js b/src/postTools.js
index a0e5f72ebd..7759f7ef60 100644
--- a/src/postTools.js
+++ b/src/postTools.js
@@ -95,6 +95,10 @@ marked.setOptions({
threadTools.delete(tid, -1, function(err) {
if (err) console.log('Error: Could not delete topic (tid: ' + tid + ')');
});
+ } else {
+ posts.getPostField(pid, 'timestamp', function(timestamp) {
+ topics.updateTimestamp(tid, timestamp);
+ });
}
});
});
diff --git a/src/posts.js b/src/posts.js
index 9250f37ba5..2cdb50e61e 100644
--- a/src/posts.js
+++ b/src/posts.js
@@ -297,7 +297,7 @@ marked.setOptions({
topics.increasePostCount(tid);
topics.setTopicField(tid, 'lastposttime', timestamp);
- topics.addToRecent(tid, timestamp);
+ topics.updateTimestamp(tid, timestamp);
RDB.incr('totalpostcount');
@@ -316,9 +316,7 @@ marked.setOptions({
RDB.sadd('cid:' + cid + ':active_users', uid);
});
- });
-
-
+ });
user.onNewPostMade(uid, tid, pid, timestamp);
diff --git a/src/topics.js b/src/topics.js
index e613e521d6..bb53236273 100644
--- a/src/topics.js
+++ b/src/topics.js
@@ -450,7 +450,7 @@ marked.setOptions({
});
}
- Topics.addToRecent = function(tid, timestamp) {
+ Topics.updateTimestamp = function(tid, timestamp) {
RDB.zadd(schema.topics().recent, timestamp, tid);
}