]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/process/process-create.ts
Refractor activity pub lib/helpers
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / process / process-create.ts
similarity index 85%
rename from server/lib/activitypub/process-create.ts
rename to server/lib/activitypub/process/process-create.ts
index de8e09adf61d98c6f840bb34b9761c944a446894..aac941a6c9bf644f620ea5cfc5fc9c848e57cfe3 100644 (file)
@@ -1,9 +1,9 @@
-import { ActivityCreate, VideoChannelObject } from '../../../shared'
-import { VideoAbuseObject } from '../../../shared/models/activitypub/objects/video-abuse-object'
-import { logger, retryTransactionWrapper } from '../../helpers'
-import { getActivityPubUrl, getOrCreateAccount } from '../../helpers/activitypub'
-import { database as db } from '../../initializers'
-import { AccountInstance } from '../../models/account/account-interface'
+import { ActivityCreate, VideoChannelObject } from '../../../../shared'
+import { VideoAbuseObject } from '../../../../shared/models/activitypub/objects/video-abuse-object'
+import { logger, retryTransactionWrapper } from '../../../helpers'
+import { getOrCreateAccount, getVideoChannelActivityPubUrl } from '../../../helpers/activitypub'
+import { database as db } from '../../../initializers'
+import { AccountInstance } from '../../../models/account/account-interface'
 import { videoChannelActivityObjectToDBAttributes } from './misc'
 
 async function processCreateActivity (activity: ActivityCreate) {
@@ -47,7 +47,7 @@ function addRemoteVideoChannel (account: AccountInstance, videoChannelToCreateDa
 
     const videoChannelData = videoChannelActivityObjectToDBAttributes(videoChannelToCreateData, account)
     videoChannel = db.VideoChannel.build(videoChannelData)
-    videoChannel.url = getActivityPubUrl('videoChannel', videoChannel.uuid)
+    videoChannel.url = getVideoChannelActivityPubUrl(videoChannel)
 
     videoChannel = await videoChannel.save({ transaction: t })
     logger.info('Remote video channel with uuid %s inserted.', videoChannelToCreateData.uuid)