aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/process/process-undo.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/activitypub/process/process-undo.ts')
-rw-r--r--server/lib/activitypub/process/process-undo.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/lib/activitypub/process/process-undo.ts b/server/lib/activitypub/process/process-undo.ts
index 5a770bb97..565e70289 100644
--- a/server/lib/activitypub/process/process-undo.ts
+++ b/server/lib/activitypub/process/process-undo.ts
@@ -1,5 +1,6 @@
1import { ActivityFollow, ActivityLike, ActivityUndo } from '../../../../shared/models/activitypub' 1import { ActivityFollow, ActivityLike, ActivityUndo } from '../../../../shared/models/activitypub'
2import { DislikeObject } from '../../../../shared/models/activitypub/objects' 2import { DislikeObject } from '../../../../shared/models/activitypub/objects'
3import { getActorUrl } from '../../../helpers/activitypub'
3import { retryTransactionWrapper } from '../../../helpers/database-utils' 4import { retryTransactionWrapper } from '../../../helpers/database-utils'
4import { logger } from '../../../helpers/logger' 5import { logger } from '../../../helpers/logger'
5import { sequelizeTypescript } from '../../../initializers' 6import { sequelizeTypescript } from '../../../initializers'
@@ -13,12 +14,14 @@ import { getOrCreateAccountAndVideoAndChannel } from '../videos'
13async function processUndoActivity (activity: ActivityUndo) { 14async function processUndoActivity (activity: ActivityUndo) {
14 const activityToUndo = activity.object 15 const activityToUndo = activity.object
15 16
17 const actorUrl = getActorUrl(activity.actor)
18
16 if (activityToUndo.type === 'Like') { 19 if (activityToUndo.type === 'Like') {
17 return processUndoLike(activity.actor, activity) 20 return processUndoLike(actorUrl, activity)
18 } else if (activityToUndo.type === 'Create' && activityToUndo.object.type === 'Dislike') { 21 } else if (activityToUndo.type === 'Create' && activityToUndo.object.type === 'Dislike') {
19 return processUndoDislike(activity.actor, activity) 22 return processUndoDislike(actorUrl, activity)
20 } else if (activityToUndo.type === 'Follow') { 23 } else if (activityToUndo.type === 'Follow') {
21 return processUndoFollow(activity.actor, activityToUndo) 24 return processUndoFollow(actorUrl, activityToUndo)
22 } 25 }
23 26
24 logger.warn('Unknown activity object type %s -> %s when undo activity.', activityToUndo.type, { activity: activity.id }) 27 logger.warn('Unknown activity object type %s -> %s when undo activity.', activityToUndo.type, { activity: activity.id })