1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Handle HTML is comments

This commit is contained in:
Chocobozzz 2018-01-04 17:50:30 +01:00
parent c3badc81fe
commit 2890b615f3
No known key found for this signature in database
GPG key ID: 583A612D890159BE
11 changed files with 100 additions and 114 deletions

View file

@ -11,8 +11,9 @@ import { getOrCreateActorAndServerAndModel } from '../actor'
async function processDeleteActivity (activity: ActivityDelete) {
const actor = await getOrCreateActorAndServerAndModel(activity.actor)
const objectUrl = typeof activity.object === 'string' ? activity.object : activity.object.id
if (actor.url === activity.object) {
if (actor.url === objectUrl) {
if (actor.type === 'Person') {
if (!actor.Account) throw new Error('Actor ' + actor.url + ' is a person but we cannot find it in database.')
@ -25,14 +26,14 @@ async function processDeleteActivity (activity: ActivityDelete) {
}
{
const videoCommentInstance = await VideoCommentModel.loadByUrlAndPopulateAccount(activity.object)
const videoCommentInstance = await VideoCommentModel.loadByUrlAndPopulateAccount(objectUrl)
if (videoCommentInstance) {
return processDeleteVideoComment(actor, videoCommentInstance)
}
}
{
const videoInstance = await VideoModel.loadByUrlAndPopulateAccount(activity.object)
const videoInstance = await VideoModel.loadByUrlAndPopulateAccount(objectUrl)
if (videoInstance) {
return processDeleteVideo(actor, videoInstance)
}