mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Stronger actor association typing in AP functions
This commit is contained in:
parent
511765c9f8
commit
5224c394b3
31 changed files with 146 additions and 89 deletions
|
@ -3,12 +3,12 @@ import { VideoAbuseObject } from '../../../../shared/models/activitypub/objects'
|
|||
import { retryTransactionWrapper } from '../../../helpers/database-utils'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
import { sequelizeTypescript } from '../../../initializers'
|
||||
import { ActorModel } from '../../../models/activitypub/actor'
|
||||
import { VideoAbuseModel } from '../../../models/video/video-abuse'
|
||||
import { getOrCreateVideoAndAccountAndChannel } from '../videos'
|
||||
import { Notifier } from '../../notifier'
|
||||
import { getAPId } from '../../../helpers/activitypub'
|
||||
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
|
||||
import { SignatureActorModel } from '../../../typings/models'
|
||||
|
||||
async function processFlagActivity (options: APProcessorOptions<ActivityCreate | ActivityFlag>) {
|
||||
const { activity, byActor } = options
|
||||
|
@ -23,7 +23,7 @@ export {
|
|||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
async function processCreateVideoAbuse (activity: ActivityCreate | ActivityFlag, byActor: ActorModel) {
|
||||
async function processCreateVideoAbuse (activity: ActivityCreate | ActivityFlag, byActor: SignatureActorModel) {
|
||||
const flag = activity.type === 'Flag' ? activity : (activity.object as VideoAbuseObject)
|
||||
|
||||
logger.debug('Reporting remote abuse for video %s.', getAPId(flag.object))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue