diff options
Diffstat (limited to 'server/lib/activitypub/process/process-undo.ts')
-rw-r--r-- | server/lib/activitypub/process/process-undo.ts | 9 |
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 @@ | |||
1 | import { ActivityFollow, ActivityLike, ActivityUndo } from '../../../../shared/models/activitypub' | 1 | import { ActivityFollow, ActivityLike, ActivityUndo } from '../../../../shared/models/activitypub' |
2 | import { DislikeObject } from '../../../../shared/models/activitypub/objects' | 2 | import { DislikeObject } from '../../../../shared/models/activitypub/objects' |
3 | import { getActorUrl } from '../../../helpers/activitypub' | ||
3 | import { retryTransactionWrapper } from '../../../helpers/database-utils' | 4 | import { retryTransactionWrapper } from '../../../helpers/database-utils' |
4 | import { logger } from '../../../helpers/logger' | 5 | import { logger } from '../../../helpers/logger' |
5 | import { sequelizeTypescript } from '../../../initializers' | 6 | import { sequelizeTypescript } from '../../../initializers' |
@@ -13,12 +14,14 @@ import { getOrCreateAccountAndVideoAndChannel } from '../videos' | |||
13 | async function processUndoActivity (activity: ActivityUndo) { | 14 | async 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 }) |