From 3cdcc207b988592e36cab3e550038221cbb0624e Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Fri, 16 Dec 2022 01:06:12 +0100 Subject: [PATCH] Finalise POST-Move --- locales/de-DE.yml | 2 +- locales/en-US.yml | 2 +- .../backend/src/server/api/endpoints/antennas/create.ts | 1 + packages/backend/src/server/api/endpoints/app/create.ts | 4 ++++ packages/backend/src/server/api/endpoints/notes/create.ts | 2 +- .../src/server/api/endpoints/notes/reactions/create.ts | 6 ++++++ 6 files changed, 14 insertions(+), 3 deletions(-) diff --git a/locales/de-DE.yml b/locales/de-DE.yml index 2dd9691831..18e96ff761 100644 --- a/locales/de-DE.yml +++ b/locales/de-DE.yml @@ -89,7 +89,7 @@ privacy: "Privatsphäre" makeFollowManuallyApprove: "Follow-Anfragen benötigen Bestätigung" defaultNoteVisibility: "Standardsichtbarkeit" follow: "Folgen" -followRequest: "Follow-Anfrage senden" +followRequest: "Follow anfragen" followRequests: "Follow-Anfragen" unfollow: "Nicht mehr folgen" followRequestPending: "Follow-Anfrage ausstehend" diff --git a/locales/en-US.yml b/locales/en-US.yml index 8e030d610d..b3b2788f08 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -89,7 +89,7 @@ privacy: "Privacy" makeFollowManuallyApprove: "Follow requests require approval" defaultNoteVisibility: "Default visibility" follow: "Follow" -followRequest: "Send follow request" +followRequest: "Request follow" followRequests: "Follow requests" unfollow: "Unfollow" followRequestPending: "Follow request pending" diff --git a/packages/backend/src/server/api/endpoints/antennas/create.ts b/packages/backend/src/server/api/endpoints/antennas/create.ts index 7a4923b944..ae85c44cfb 100644 --- a/packages/backend/src/server/api/endpoints/antennas/create.ts +++ b/packages/backend/src/server/api/endpoints/antennas/create.ts @@ -62,6 +62,7 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { + if(user.movedToUri != null) throw new ApiError(meta.errors.noSuchUserGroup); let userList; let userGroupJoining; diff --git a/packages/backend/src/server/api/endpoints/app/create.ts b/packages/backend/src/server/api/endpoints/app/create.ts index a0a7350822..15b2089e7e 100644 --- a/packages/backend/src/server/api/endpoints/app/create.ts +++ b/packages/backend/src/server/api/endpoints/app/create.ts @@ -31,6 +31,10 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { + if(user && user.movedToUri != null) return await Apps.pack("", null, { + detail: true, + includeSecret: true, + });; // Generate secret const secret = secureRndstr(32, true); diff --git a/packages/backend/src/server/api/endpoints/notes/create.ts b/packages/backend/src/server/api/endpoints/notes/create.ts index 68c04ff229..1dc8b42b24 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.ts @@ -169,7 +169,7 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { - if(user.movedToUri) throw new ApiError(meta.errors.accountLocked); + if(user.movedToUri != null) throw new ApiError(meta.errors.accountLocked); let visibleUsers: User[] = []; if (ps.visibleUserIds) { visibleUsers = await Users.findBy({ diff --git a/packages/backend/src/server/api/endpoints/notes/reactions/create.ts b/packages/backend/src/server/api/endpoints/notes/reactions/create.ts index b5c0c9d179..4c767b4890 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions/create.ts @@ -28,6 +28,11 @@ export const meta = { code: 'YOU_HAVE_BEEN_BLOCKED', id: '20ef5475-9f38-4e4c-bd33-de6d979498ec', }, + accountLocked: { + message: 'You migrated. Your account is now locked.', + code: 'ACCOUNT_LOCKED', + id: 'd390d7e1-8a5e-46ed-b625-06271cafd3d3', + }, }, } as const; @@ -42,6 +47,7 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { + if(user.movedToUri != null) throw new ApiError(meta.errors.accountLocked); const note = await getNote(ps.noteId, user).catch(err => { if (err.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote); throw err;