mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 10:49:28 +02:00
Correctly forward like/dislikes and undo
This commit is contained in:
parent
d4f1e94c89
commit
63c93323ec
15 changed files with 246 additions and 134 deletions
|
@ -1,21 +1,16 @@
|
|||
import { logger } from '../../../helpers'
|
||||
import { buildSignedActivity } from '../../../helpers/activitypub'
|
||||
import { doRequest } from '../../../helpers/requests'
|
||||
import { database as db } from '../../../initializers'
|
||||
import { ActivityPubHttpPayload, maybeRetryRequestLater } from './activitypub-http-job-scheduler'
|
||||
import { ActivityPubHttpPayload, computeBody, maybeRetryRequestLater } from './activitypub-http-job-scheduler'
|
||||
|
||||
async function process (payload: ActivityPubHttpPayload, jobId: number) {
|
||||
logger.info('Processing ActivityPub broadcast in job %d.', jobId)
|
||||
|
||||
const accountSignature = await db.Account.load(payload.signatureAccountId)
|
||||
if (!accountSignature) throw new Error('Unknown signature account id.')
|
||||
|
||||
const signedBody = await buildSignedActivity(accountSignature, payload.body)
|
||||
const body = await computeBody(payload)
|
||||
|
||||
const options = {
|
||||
method: 'POST',
|
||||
uri: '',
|
||||
json: signedBody
|
||||
json: body
|
||||
}
|
||||
|
||||
for (const uri of payload.uris) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue