mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 06:55:46 +01:00
@@ -109,6 +109,7 @@ var RDB = require('./redis.js'),
|
|||||||
postSearch.remove(pid);
|
postSearch.remove(pid);
|
||||||
|
|
||||||
posts.getPostFields(pid, ['tid', 'uid'], function(postData) {
|
posts.getPostFields(pid, ['tid', 'uid'], function(postData) {
|
||||||
|
RDB.hincrby('topic:'+postData.tid, 'postcount', -1);
|
||||||
|
|
||||||
user.decrementUserFieldBy(postData.uid, 'postcount', 1, function(err, postcount) {
|
user.decrementUserFieldBy(postData.uid, 'postcount', 1, function(err, postcount) {
|
||||||
RDB.zadd('users:postcount', postcount, postData.uid);
|
RDB.zadd('users:postcount', postcount, postData.uid);
|
||||||
@@ -145,6 +146,7 @@ var RDB = require('./redis.js'),
|
|||||||
posts.setPostField(pid, 'deleted', 0);
|
posts.setPostField(pid, 'deleted', 0);
|
||||||
|
|
||||||
posts.getPostFields(pid, ['tid', 'uid', 'content'], function(postData) {
|
posts.getPostFields(pid, ['tid', 'uid', 'content'], function(postData) {
|
||||||
|
RDB.hincrby('topic:'+postData.tid, 'postcount', 1);
|
||||||
|
|
||||||
user.incrementUserFieldBy(postData.uid, 'postcount', 1);
|
user.incrementUserFieldBy(postData.uid, 'postcount', 1);
|
||||||
|
|
||||||
@@ -158,6 +160,13 @@ var RDB = require('./redis.js'),
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Restore topic if it is the only post
|
||||||
|
topics.getTopicField(postData.tid, 'postcount', function(err, count) {
|
||||||
|
if (count === '1') {
|
||||||
|
threadTools.restore(postData.tid, uid);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
postSearch.index(postData.content, pid);
|
postSearch.index(postData.content, pid);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user