diff options
Diffstat (limited to 'server/lib/activitypub/process/process-like.ts')
-rw-r--r-- | server/lib/activitypub/process/process-like.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/server/lib/activitypub/process/process-like.ts b/server/lib/activitypub/process/process-like.ts index 0dca17551..e8e97eece 100644 --- a/server/lib/activitypub/process/process-like.ts +++ b/server/lib/activitypub/process/process-like.ts | |||
@@ -5,8 +5,7 @@ import { AccountVideoRateModel } from '../../../models/account/account-video-rat | |||
5 | import { ActorModel } from '../../../models/activitypub/actor' | 5 | import { ActorModel } from '../../../models/activitypub/actor' |
6 | import { forwardVideoRelatedActivity } from '../send/utils' | 6 | import { forwardVideoRelatedActivity } from '../send/utils' |
7 | import { getOrCreateVideoAndAccountAndChannel } from '../videos' | 7 | import { getOrCreateVideoAndAccountAndChannel } from '../videos' |
8 | import { immutableAssign } from '../../../tests/utils' | 8 | import { getVideoLikeActivityPubUrl } from '../url' |
9 | import { getVideoDislikeActivityPubUrl, getVideoLikeActivityPubUrl } from '../url' | ||
10 | 9 | ||
11 | async function processLikeActivity (activity: ActivityLike, byActor: ActorModel) { | 10 | async function processLikeActivity (activity: ActivityLike, byActor: ActorModel) { |
12 | return retryTransactionWrapper(processLikeVideo, byActor, activity) | 11 | return retryTransactionWrapper(processLikeVideo, byActor, activity) |
@@ -36,7 +35,7 @@ async function processLikeVideo (byActor: ActorModel, activity: ActivityLike) { | |||
36 | } | 35 | } |
37 | const [ , created ] = await AccountVideoRateModel.findOrCreate({ | 36 | const [ , created ] = await AccountVideoRateModel.findOrCreate({ |
38 | where: rate, | 37 | where: rate, |
39 | defaults: immutableAssign(rate, { url: getVideoLikeActivityPubUrl(byActor, video) }), | 38 | defaults: Object.assign({}, rate, { url: getVideoLikeActivityPubUrl(byActor, video) }), |
40 | transaction: t | 39 | transaction: t |
41 | }) | 40 | }) |
42 | if (created === true) await video.increment('likes', { transaction: t }) | 41 | if (created === true) await video.increment('likes', { transaction: t }) |