diff --git a/server/core/lib/activitypub/url.ts b/server/core/lib/activitypub/url.ts index 9f428029b..0f7aec44e 100644 --- a/server/core/lib/activitypub/url.ts +++ b/server/core/lib/activitypub/url.ts @@ -125,10 +125,13 @@ export function getLocalApproveReplyActivityPubUrl (video: MVideoUUID, comment: // --------------------------------------------------------------------------- -export function getAbuseTargetUrl (abuse: MAbuseFull) { +// Try to fetch target URL +// If it doesn't exist anymore use abuse URL +export function getAbuseIdentifier (abuse: MAbuseFull) { return abuse.VideoAbuse?.Video?.url || abuse.VideoCommentAbuse?.VideoComment?.url || - abuse.FlaggedAccount.Actor.url + abuse.FlaggedAccount?.Actor?.url || + abuse.id + '' } // --------------------------------------------------------------------------- diff --git a/server/core/lib/notifier/shared/abuse/abuse-state-change-for-reporter.ts b/server/core/lib/notifier/shared/abuse/abuse-state-change-for-reporter.ts index 5e18e9fc9..0a1b6980f 100644 --- a/server/core/lib/notifier/shared/abuse/abuse-state-change-for-reporter.ts +++ b/server/core/lib/notifier/shared/abuse/abuse-state-change-for-reporter.ts @@ -1,6 +1,6 @@ import { logger } from '@server/helpers/logger.js' import { WEBSERVER } from '@server/initializers/constants.js' -import { getAbuseTargetUrl } from '@server/lib/activitypub/url.js' +import { getAbuseIdentifier } from '@server/lib/activitypub/url.js' import { UserModel } from '@server/models/user/user.js' import { UserNotificationModel } from '@server/models/user/user-notification.js' import { MAbuseFull, MUserDefault, MUserWithNotificationSetting, UserNotificationModelForApi } from '@server/types/models/index.js' @@ -19,7 +19,7 @@ export class AbuseStateChangeForReporter extends AbstractNotification