mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +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
|
@ -1,10 +1,10 @@
|
|||
import { ActivityFollow } from '../../../../shared/models/activitypub'
|
||||
import { ActorModel } from '../../../models/activitypub/actor'
|
||||
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
|
||||
import { getActorFollowActivityPubUrl } from '../url'
|
||||
import { unicastTo } from './utils'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
import { Transaction } from 'sequelize'
|
||||
import { ActorModelOnly } from '../../../typings/models'
|
||||
|
||||
function sendFollow (actorFollow: ActorFollowModel, t: Transaction) {
|
||||
const me = actorFollow.ActorFollower
|
||||
|
@ -21,7 +21,7 @@ function sendFollow (actorFollow: ActorFollowModel, t: Transaction) {
|
|||
t.afterCommit(() => unicastTo(data, me, following.inboxUrl))
|
||||
}
|
||||
|
||||
function buildFollowActivity (url: string, byActor: ActorModel, targetActor: ActorModel): ActivityFollow {
|
||||
function buildFollowActivity (url: string, byActor: ActorModelOnly, targetActor: ActorModelOnly): ActivityFollow {
|
||||
return {
|
||||
type: 'Follow',
|
||||
id: url,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue