mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-06 03:50:26 +02:00
Fix incorrect IDs in AP federation
This commit is contained in:
parent
3fba4b6bce
commit
de94ac86a2
34 changed files with 281 additions and 236 deletions
|
@ -1,11 +1,11 @@
|
|||
import { ActivityFollow, ActivityReject } from '../../../../shared/models/activitypub'
|
||||
import { getActorFollowActivityPubUrl, getActorFollowRejectActivityPubUrl } from '../url'
|
||||
import { unicastTo } from './utils'
|
||||
import { buildFollowActivity } from './send-follow'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
import { MActor } from '../../../types/models'
|
||||
import { getLocalActorFollowRejectActivityPubUrl } from '../url'
|
||||
import { buildFollowActivity } from './send-follow'
|
||||
import { unicastTo } from './utils'
|
||||
|
||||
function sendReject (follower: MActor, following: MActor) {
|
||||
function sendReject (followUrl: string, follower: MActor, following: MActor) {
|
||||
if (!follower.serverId) { // This should never happen
|
||||
logger.warn('Do not sending reject to local follower.')
|
||||
return
|
||||
|
@ -13,10 +13,9 @@ function sendReject (follower: MActor, following: MActor) {
|
|||
|
||||
logger.info('Creating job to reject follower %s.', follower.url)
|
||||
|
||||
const followUrl = getActorFollowActivityPubUrl(follower, following)
|
||||
const followData = buildFollowActivity(followUrl, follower, following)
|
||||
|
||||
const url = getActorFollowRejectActivityPubUrl(follower, following)
|
||||
const url = getLocalActorFollowRejectActivityPubUrl(follower, following)
|
||||
const data = buildRejectActivity(url, following, followData)
|
||||
|
||||
return unicastTo(data, following, follower.inboxUrl)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue