mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
check nsfw content in the background
This commit is contained in:
parent
fe4198d884
commit
8db0175378
@ -1,6 +1,8 @@
|
|||||||
import { Post } from "../../../models"
|
|
||||||
import getPostData from "./getPostData"
|
|
||||||
import momentTimezone from "moment-timezone"
|
import momentTimezone from "moment-timezone"
|
||||||
|
import { Post } from "../../../models"
|
||||||
|
|
||||||
|
import getPostData from "./getPostData"
|
||||||
|
import flagNsfwByAttachments from "./flagNsfwByAttachments"
|
||||||
|
|
||||||
export default async (payload) => {
|
export default async (payload) => {
|
||||||
let { user_id, message, attachments, type, data, timestamp } = payload
|
let { user_id, message, attachments, type, data, timestamp } = payload
|
||||||
@ -27,6 +29,7 @@ export default async (payload) => {
|
|||||||
attachments: attachments ?? [],
|
attachments: attachments ?? [],
|
||||||
timestamp: timestamp,
|
timestamp: timestamp,
|
||||||
data: data,
|
data: data,
|
||||||
|
flags: [],
|
||||||
})
|
})
|
||||||
|
|
||||||
await post.save()
|
await post.save()
|
||||||
@ -36,5 +39,8 @@ export default async (payload) => {
|
|||||||
global.wsInterface.io.emit(`post.new`, resultPost)
|
global.wsInterface.io.emit(`post.new`, resultPost)
|
||||||
global.wsInterface.io.emit(`post.new.${post.user_id}`, resultPost)
|
global.wsInterface.io.emit(`post.new.${post.user_id}`, resultPost)
|
||||||
|
|
||||||
|
// push to background job to check if is NSFW
|
||||||
|
flagNsfwByAttachments(post._id.toString())
|
||||||
|
|
||||||
return post
|
return post
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user