|
|
|
@ -60,6 +60,7 @@ module.exports = function (Posts) {
|
|
|
|
|
deletePostFromUsersVotes(pid),
|
|
|
|
|
deletePostFromReplies(postData),
|
|
|
|
|
deletePostFromGroups(postData),
|
|
|
|
|
deletePostDiffs(pid),
|
|
|
|
|
db.sortedSetsRemove(['posts:pid', 'posts:votes', 'posts:flagged'], pid),
|
|
|
|
|
Posts.uploads.dissociateAll(pid),
|
|
|
|
|
]);
|
|
|
|
@ -144,4 +145,12 @@ module.exports = function (Posts) {
|
|
|
|
|
const keys = groupNames[0].map(groupName => `group:${groupName}:member:pids`);
|
|
|
|
|
await db.sortedSetsRemove(keys, postData.pid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function deletePostDiffs(pid) {
|
|
|
|
|
const timestamps = await Posts.diffs.list(pid);
|
|
|
|
|
await db.deleteAll([
|
|
|
|
|
`post:${pid}:diffs`,
|
|
|
|
|
...timestamps.map(t => `diff:${pid}.${t}`),
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|