diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-09 08:17:16 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-08-09 08:17:16 +0200 |
commit | 5224c394b3bbac6ec1543e41fa0ec6db436e84fa (patch) | |
tree | 36eaecfe095547aca903a8a43fb6e0b0b01899a9 /server/lib/activitypub/send/send-follow.ts | |
parent | 511765c9f86fb07d5d856decd9dbf0ec2092f4fe (diff) | |
download | PeerTube-5224c394b3bbac6ec1543e41fa0ec6db436e84fa.tar.gz PeerTube-5224c394b3bbac6ec1543e41fa0ec6db436e84fa.tar.zst PeerTube-5224c394b3bbac6ec1543e41fa0ec6db436e84fa.zip |
Stronger actor association typing in AP functions
Diffstat (limited to 'server/lib/activitypub/send/send-follow.ts')
-rw-r--r-- | server/lib/activitypub/send/send-follow.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/lib/activitypub/send/send-follow.ts b/server/lib/activitypub/send/send-follow.ts index c6e7fe83d..a59ed50cf 100644 --- a/server/lib/activitypub/send/send-follow.ts +++ b/server/lib/activitypub/send/send-follow.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { ActivityFollow } from '../../../../shared/models/activitypub' | 1 | import { ActivityFollow } from '../../../../shared/models/activitypub' |
2 | import { ActorModel } from '../../../models/activitypub/actor' | ||
3 | import { ActorFollowModel } from '../../../models/activitypub/actor-follow' | 2 | import { ActorFollowModel } from '../../../models/activitypub/actor-follow' |
4 | import { getActorFollowActivityPubUrl } from '../url' | 3 | import { getActorFollowActivityPubUrl } from '../url' |
5 | import { unicastTo } from './utils' | 4 | import { unicastTo } from './utils' |
6 | import { logger } from '../../../helpers/logger' | 5 | import { logger } from '../../../helpers/logger' |
7 | import { Transaction } from 'sequelize' | 6 | import { Transaction } from 'sequelize' |
7 | import { ActorModelOnly } from '../../../typings/models' | ||
8 | 8 | ||
9 | function sendFollow (actorFollow: ActorFollowModel, t: Transaction) { | 9 | function sendFollow (actorFollow: ActorFollowModel, t: Transaction) { |
10 | const me = actorFollow.ActorFollower | 10 | const me = actorFollow.ActorFollower |
@@ -21,7 +21,7 @@ function sendFollow (actorFollow: ActorFollowModel, t: Transaction) { | |||
21 | t.afterCommit(() => unicastTo(data, me, following.inboxUrl)) | 21 | t.afterCommit(() => unicastTo(data, me, following.inboxUrl)) |
22 | } | 22 | } |
23 | 23 | ||
24 | function buildFollowActivity (url: string, byActor: ActorModel, targetActor: ActorModel): ActivityFollow { | 24 | function buildFollowActivity (url: string, byActor: ActorModelOnly, targetActor: ActorModelOnly): ActivityFollow { |
25 | return { | 25 | return { |
26 | type: 'Follow', | 26 | type: 'Follow', |
27 | id: url, | 27 | id: url, |