mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-13 17:35:46 +01:00
fixing topic deletion and purging
This commit is contained in:
@@ -128,7 +128,7 @@ module.exports = function(Posts) {
|
|||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins.fireHook('action:post.delete', pid);
|
plugins.fireHook('action:post.purge', pid);
|
||||||
db.delete('post:' + pid, callback);
|
db.delete('post:' + pid, callback);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ var winston = require('winston'),
|
|||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
ThreadTools[isDelete ? 'lock' : 'unlock'](tid);
|
ThreadTools[isDelete ? 'lock' : 'unlock'](tid, uid);
|
||||||
if (isDelete) {
|
if (isDelete) {
|
||||||
plugins.fireHook('action:topic.delete', tid);
|
plugins.fireHook('action:topic.delete', tid);
|
||||||
} else {
|
} else {
|
||||||
@@ -119,7 +119,7 @@ var winston = require('winston'),
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err) {
|
if (err && typeof callback === 'function') {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,10 +134,12 @@ var winston = require('winston'),
|
|||||||
emitTo('topic_' + tid);
|
emitTo('topic_' + tid);
|
||||||
emitTo('category_' + cid);
|
emitTo('category_' + cid);
|
||||||
|
|
||||||
|
if (typeof callback === 'function') {
|
||||||
callback(null, {
|
callback(null, {
|
||||||
tid: tid,
|
tid: tid,
|
||||||
isLocked: lock
|
isLocked: lock
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ module.exports = function(Topics) {
|
|||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
plugins.fireHook('action:topic.delete', tid);
|
plugins.fireHook('action:topic.purge', tid);
|
||||||
db.delete('topic:' + tid, callback);
|
db.delete('topic:' + tid, callback);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user