1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Begin moving video channel to actor

This commit is contained in:
Chocobozzz 2017-12-14 17:38:41 +01:00
parent fadf619ad6
commit 50d6de9c28
No known key found for this signature in database
GPG key ID: 583A612D890159BE
100 changed files with 1761 additions and 2041 deletions

View file

@ -1,26 +1,26 @@
import { Transaction } from 'sequelize'
import { ActivityFollow } from '../../../../shared/models/activitypub'
import { AccountModel } from '../../../models/account/account'
import { AccountFollowModel } from '../../../models/account/account-follow'
import { getAccountFollowActivityPubUrl } from '../url'
import { ActorModel } from '../../../models/activitypub/actor'
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
import { getActorFollowActivityPubUrl } from '../url'
import { unicastTo } from './misc'
function sendFollow (accountFollow: AccountFollowModel, t: Transaction) {
const me = accountFollow.AccountFollower
const following = accountFollow.AccountFollowing
function sendFollow (actorFollow: ActorFollowModel, t: Transaction) {
const me = actorFollow.ActorFollower
const following = actorFollow.ActorFollowing
const url = getAccountFollowActivityPubUrl(accountFollow)
const url = getActorFollowActivityPubUrl(actorFollow)
const data = followActivityData(url, me, following)
return unicastTo(data, me, following.inboxUrl, t)
}
function followActivityData (url: string, byAccount: AccountModel, targetAccount: AccountModel): ActivityFollow {
function followActivityData (url: string, byActor: ActorModel, targetActor: ActorModel): ActivityFollow {
return {
type: 'Follow',
id: url,
actor: byAccount.url,
object: targetAccount.url
actor: byActor.url,
object: targetActor.url
}
}