unoffical wafrn mirror
wafrn.net
atproto
social-network
activitypub
1import { completeEnvironment } from '../backendOptions.js'
2import { activityPubObject } from '../../interfaces/fediverse/activityPubObject.js'
3import { postPetitionSigned } from './postPetitionSigned.js'
4
5async function remoteFollow(localUser: any, remoteUser: any) {
6 const petitionBody: activityPubObject = {
7 '@context': 'https://www.w3.org/ns/activitystreams',
8 id: `${completeEnvironment.frontendUrl}/fediverse/follows/${localUser.id}/${remoteUser.id}`,
9 type: 'Follow',
10 actor: `${completeEnvironment.frontendUrl}/fediverse/blog/${localUser.url.toLowerCase()}`,
11 object: remoteUser.remoteId
12 }
13 const followPetition = await postPetitionSigned(petitionBody, localUser, remoteUser.remoteInbox)
14 return followPetition
15}
16
17export { remoteFollow }