fixing topic deletion and purging

v1.18.x
Julian Lam 10 years ago
parent 5281c8c376
commit f9f1cf63cf

@ -128,7 +128,7 @@ module.exports = function(Posts) {
return callback(err);
}
plugins.fireHook('action:post.delete', pid);
plugins.fireHook('action:post.purge', pid);
db.delete('post:' + pid, callback);
});
});

@ -53,7 +53,7 @@ var winston = require('winston'),
return callback(err);
}
ThreadTools[isDelete ? 'lock' : 'unlock'](tid);
ThreadTools[isDelete ? 'lock' : 'unlock'](tid, uid);
if (isDelete) {
plugins.fireHook('action:topic.delete', tid);
} else {
@ -119,7 +119,7 @@ var winston = require('winston'),
});
}
if (err) {
if (err && typeof callback === 'function') {
return callback(err);
}
@ -134,10 +134,12 @@ var winston = require('winston'),
emitTo('topic_' + tid);
emitTo('category_' + cid);
callback(null, {
tid: tid,
isLocked: lock
});
if (typeof callback === 'function') {
callback(null, {
tid: tid,
isLocked: lock
});
}
});
}

@ -66,7 +66,7 @@ module.exports = function(Topics) {
if (err) {
return callback(err);
}
plugins.fireHook('action:topic.delete', tid);
plugins.fireHook('action:topic.purge', tid);
db.delete('topic:' + tid, callback);
});
};

Loading…
Cancel
Save