1
0
Fork 0
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:
Chocobozzz 2017-11-24 13:41:10 +01:00
parent d4f1e94c89
commit 63c93323ec
No known key found for this signature in database
GPG key ID: 583A612D890159BE
15 changed files with 246 additions and 134 deletions

View file

@ -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) {