mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-14 09:55:47 +01:00
dont add topic to topics:recent if its deleted
This commit is contained in:
@@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var async = require('async'),
|
var async = require('async');
|
||||||
winston = require('winston'),
|
var db = require('../database');
|
||||||
db = require('../database');
|
|
||||||
|
|
||||||
module.exports = function(Topics) {
|
module.exports = function(Topics) {
|
||||||
var terms = {
|
var terms = {
|
||||||
@@ -42,12 +41,22 @@ module.exports = function(Topics) {
|
|||||||
Topics.updateTimestamp = function(tid, timestamp, callback) {
|
Topics.updateTimestamp = function(tid, timestamp, callback) {
|
||||||
async.parallel([
|
async.parallel([
|
||||||
function(next) {
|
function(next) {
|
||||||
|
async.waterfall([
|
||||||
|
function (next) {
|
||||||
|
Topics.getTopicField(tid, 'deleted', next);
|
||||||
|
},
|
||||||
|
function (deleted, next) {
|
||||||
|
if (parseInt(deleted, 10) === 1) {
|
||||||
|
return next();
|
||||||
|
}
|
||||||
Topics.updateRecent(tid, timestamp, next);
|
Topics.updateRecent(tid, timestamp, next);
|
||||||
|
}
|
||||||
|
], next);
|
||||||
},
|
},
|
||||||
function(next) {
|
function(next) {
|
||||||
Topics.setTopicField(tid, 'lastposttime', timestamp, next);
|
Topics.setTopicField(tid, 'lastposttime', timestamp, next);
|
||||||
}
|
}
|
||||||
], function(err, results) {
|
], function(err) {
|
||||||
callback(err);
|
callback(err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user