when a post is restored update topic timestamp

This commit is contained in:
Baris Soner Usakli
2013-07-20 16:59:53 -04:00
parent eec5249eb6
commit f7291631d8
3 changed files with 9 additions and 3 deletions

View File

@@ -126,6 +126,12 @@ marked.setOptions({
io.sockets.in('topic_' + postData.tid).emit('event:post_restored', {
pid: pid
});
threadTools.get_latest_undeleted_pid(postData.tid, function(err, pid) {
posts.getPostField(pid, 'timestamp', function(timestamp) {
topics.updateTimestamp(postData.tid, timestamp);
});
});
});
};

View File

@@ -298,7 +298,6 @@ marked.setOptions({
});
topics.increasePostCount(tid);
topics.setTopicField(tid, 'lastposttime', timestamp);
topics.updateTimestamp(tid, timestamp);
RDB.incr('totalpostcount');

View File

@@ -452,6 +452,7 @@ marked.setOptions({
Topics.updateTimestamp = function(tid, timestamp) {
RDB.zadd(schema.topics().recent, timestamp, tid);
Topics.setTopicField(tid, 'lastposttime', timestamp);
}
}(exports));