1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Stronger actor association typing in AP functions

This commit is contained in:
Chocobozzz 2019-08-09 08:17:16 +02:00
parent 511765c9f8
commit 5224c394b3
No known key found for this signature in database
GPG key ID: 583A612D890159BE
31 changed files with 146 additions and 89 deletions

View file

@ -1,12 +1,12 @@
import { ActivityAccept, ActivityFollow } from '../../../../shared/models/activitypub'
import { ActorModel } from '../../../models/activitypub/actor'
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
import { getActorFollowAcceptActivityPubUrl, getActorFollowActivityPubUrl } from '../url'
import { unicastTo } from './utils'
import { buildFollowActivity } from './send-follow'
import { logger } from '../../../helpers/logger'
import { ActorFollowModelLight } from '../../../typings/models/actor-follow'
import { ActorModelOnly } from '../../../typings/models'
async function sendAccept (actorFollow: ActorFollowModel) {
async function sendAccept (actorFollow: ActorFollowModelLight) {
const follower = actorFollow.ActorFollower
const me = actorFollow.ActorFollowing
@ -34,7 +34,7 @@ export {
// ---------------------------------------------------------------------------
function buildAcceptActivity (url: string, byActor: ActorModel, followActivityData: ActivityFollow): ActivityAccept {
function buildAcceptActivity (url: string, byActor: ActorModelOnly, followActivityData: ActivityFollow): ActivityAccept {
return {
type: 'Accept',
id: url,