diff options
Diffstat (limited to 'server/lib/activitypub/process/process-create.ts')
-rw-r--r-- | server/lib/activitypub/process/process-create.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts index cefe89db0..920d02cd2 100644 --- a/server/lib/activitypub/process/process-create.ts +++ b/server/lib/activitypub/process/process-create.ts | |||
@@ -12,6 +12,8 @@ import { getOrCreateVideoAndAccountAndChannel } from '../videos' | |||
12 | import { forwardVideoRelatedActivity } from '../send/utils' | 12 | import { forwardVideoRelatedActivity } from '../send/utils' |
13 | import { Redis } from '../../redis' | 13 | import { Redis } from '../../redis' |
14 | import { createOrUpdateCacheFile } from '../cache-file' | 14 | import { createOrUpdateCacheFile } from '../cache-file' |
15 | import { immutableAssign } from '../../../tests/utils' | ||
16 | import { getVideoDislikeActivityPubUrl, getVideoLikeActivityPubUrl } from '../url' | ||
15 | 17 | ||
16 | async function processCreateActivity (activity: ActivityCreate, byActor: ActorModel) { | 18 | async function processCreateActivity (activity: ActivityCreate, byActor: ActorModel) { |
17 | const activityObject = activity.object | 19 | const activityObject = activity.object |
@@ -65,9 +67,10 @@ async function processCreateDislike (byActor: ActorModel, activity: ActivityCrea | |||
65 | videoId: video.id, | 67 | videoId: video.id, |
66 | accountId: byAccount.id | 68 | accountId: byAccount.id |
67 | } | 69 | } |
70 | |||
68 | const [ , created ] = await AccountVideoRateModel.findOrCreate({ | 71 | const [ , created ] = await AccountVideoRateModel.findOrCreate({ |
69 | where: rate, | 72 | where: rate, |
70 | defaults: rate, | 73 | defaults: immutableAssign(rate, { url: getVideoDislikeActivityPubUrl(byActor, video) }), |
71 | transaction: t | 74 | transaction: t |
72 | }) | 75 | }) |
73 | if (created === true) await video.increment('dislikes', { transaction: t }) | 76 | if (created === true) await video.increment('dislikes', { transaction: t }) |