aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/activitypub/process/process-accept.ts2
-rw-r--r--server/lib/activitypub/process/process-add.ts2
-rw-r--r--server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-fetcher-handler.ts6
3 files changed, 6 insertions, 4 deletions
diff --git a/server/lib/activitypub/process/process-accept.ts b/server/lib/activitypub/process/process-accept.ts
index e159c41b5..73c6cb279 100644
--- a/server/lib/activitypub/process/process-accept.ts
+++ b/server/lib/activitypub/process/process-accept.ts
@@ -1,6 +1,7 @@
1import { ActivityAccept } from '../../../../shared/models/activitypub/activity' 1import { ActivityAccept } from '../../../../shared/models/activitypub/activity'
2import { database as db } from '../../../initializers' 2import { database as db } from '../../../initializers'
3import { AccountInstance } from '../../../models/account/account-interface' 3import { AccountInstance } from '../../../models/account/account-interface'
4import { addFetchOutboxJob } from '../fetch'
4 5
5async function processAcceptActivity (activity: ActivityAccept, inboxAccount?: AccountInstance) { 6async function processAcceptActivity (activity: ActivityAccept, inboxAccount?: AccountInstance) {
6 if (inboxAccount === undefined) throw new Error('Need to accept on explicit inbox.') 7 if (inboxAccount === undefined) throw new Error('Need to accept on explicit inbox.')
@@ -24,4 +25,5 @@ async function processAccept (account: AccountInstance, targetAccount: AccountIn
24 25
25 follow.set('state', 'accepted') 26 follow.set('state', 'accepted')
26 await follow.save() 27 await follow.save()
28 await addFetchOutboxJob(targetAccount, undefined)
27} 29}
diff --git a/server/lib/activitypub/process/process-add.ts b/server/lib/activitypub/process/process-add.ts
index edc90dee5..332c18cc0 100644
--- a/server/lib/activitypub/process/process-add.ts
+++ b/server/lib/activitypub/process/process-add.ts
@@ -48,7 +48,7 @@ function addRemoteVideo (account: AccountInstance,
48 activity: ActivityAdd, 48 activity: ActivityAdd,
49 videoChannel: VideoChannelInstance, 49 videoChannel: VideoChannelInstance,
50 videoToCreateData: VideoTorrentObject) { 50 videoToCreateData: VideoTorrentObject) {
51 logger.debug('Adding remote video %s.', videoToCreateData.url) 51 logger.debug('Adding remote video %s.', videoToCreateData.id)
52 52
53 return db.sequelize.transaction(async t => { 53 return db.sequelize.transaction(async t => {
54 const sequelizeOptions = { 54 const sequelizeOptions = {
diff --git a/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-fetcher-handler.ts b/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-fetcher-handler.ts
index b8ead32a4..09efaa622 100644
--- a/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-fetcher-handler.ts
+++ b/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-fetcher-handler.ts
@@ -25,7 +25,7 @@ async function process (payload: ActivityPubHttpPayload, jobId: number) {
25 if (firstBody.first && Array.isArray(firstBody.first.orderedItems)) { 25 if (firstBody.first && Array.isArray(firstBody.first.orderedItems)) {
26 const activities = firstBody.first.orderedItems 26 const activities = firstBody.first.orderedItems
27 27
28 logger.info('Processing %i items ActivityPub fetcher for %s.', activities.length, uri) 28 logger.info('Processing %i items ActivityPub fetcher for %s.', activities.length, options.uri)
29 29
30 await processActivities(activities) 30 await processActivities(activities)
31 } 31 }
@@ -37,12 +37,12 @@ async function process (payload: ActivityPubHttpPayload, jobId: number) {
37 options.uri = nextLink 37 options.uri = nextLink
38 38
39 const { body } = await doRequest(options) 39 const { body } = await doRequest(options)
40 nextLink = body.nextLink 40 nextLink = body.next
41 i++ 41 i++
42 42
43 if (Array.isArray(body.orderedItems)) { 43 if (Array.isArray(body.orderedItems)) {
44 const activities = body.orderedItems 44 const activities = body.orderedItems
45 logger.info('Processing %i items ActivityPub fetcher for %s.', activities.length, uri) 45 logger.info('Processing %i items ActivityPub fetcher for %s.', activities.length, options.uri)
46 46
47 await processActivities(activities) 47 await processActivities(activities)
48 } 48 }