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:
parent
fadf619ad6
commit
50d6de9c28
100 changed files with 1761 additions and 2041 deletions
|
@ -1,15 +1,15 @@
|
|||
import { Transaction } from 'sequelize'
|
||||
import { ActivityAccept } from '../../../../shared/models/activitypub'
|
||||
import { AccountModel } from '../../../models/account/account'
|
||||
import { AccountFollowModel } from '../../../models/account/account-follow'
|
||||
import { getAccountFollowAcceptActivityPubUrl } from '../url'
|
||||
import { ActorModel } from '../../../models/activitypub/actor'
|
||||
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
|
||||
import { getActorFollowAcceptActivityPubUrl } from '../url'
|
||||
import { unicastTo } from './misc'
|
||||
|
||||
async function sendAccept (accountFollow: AccountFollowModel, t: Transaction) {
|
||||
const follower = accountFollow.AccountFollower
|
||||
const me = accountFollow.AccountFollowing
|
||||
async function sendAccept (actorFollow: ActorFollowModel, t: Transaction) {
|
||||
const follower = actorFollow.ActorFollower
|
||||
const me = actorFollow.ActorFollowing
|
||||
|
||||
const url = getAccountFollowAcceptActivityPubUrl(accountFollow)
|
||||
const url = getActorFollowAcceptActivityPubUrl(actorFollow)
|
||||
const data = acceptActivityData(url, me)
|
||||
|
||||
return unicastTo(data, me, follower.inboxUrl, t)
|
||||
|
@ -23,12 +23,10 @@ export {
|
|||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function acceptActivityData (url: string, byAccount: AccountModel) {
|
||||
const activity: ActivityAccept = {
|
||||
function acceptActivityData (url: string, byActor: ActorModel): ActivityAccept {
|
||||
return {
|
||||
type: 'Accept',
|
||||
id: url,
|
||||
actor: byAccount.url
|
||||
actor: byActor.url
|
||||
}
|
||||
|
||||
return activity
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue