diff options
| author | dakkar <dakkar@thenautilus.net> | 2024-05-14 16:58:06 +0100 |
|---|---|---|
| committer | dakkar <dakkar@thenautilus.net> | 2024-05-14 16:58:06 +0100 |
| commit | 42d9da161b56d38a04fb4f25c7d063bdea880ff0 (patch) | |
| tree | 7186a31f8e5219e26932ce9b1d649a12bc3f98ab /packages/backend/src/core/NoteEditService.ts | |
| parent | merge: always align code to the left - fixes #436 (!453) (diff) | |
| download | sharkey-42d9da161b56d38a04fb4f25c7d063bdea880ff0.tar.gz sharkey-42d9da161b56d38a04fb4f25c7d063bdea880ff0.tar.bz2 sharkey-42d9da161b56d38a04fb4f25c7d063bdea880ff0.zip | |
first basic protection - #524
Diffstat (limited to 'packages/backend/src/core/NoteEditService.ts')
| -rw-r--r-- | packages/backend/src/core/NoteEditService.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/backend/src/core/NoteEditService.ts b/packages/backend/src/core/NoteEditService.ts index 72fc01ae3b..435f5f017a 100644 --- a/packages/backend/src/core/NoteEditService.ts +++ b/packages/backend/src/core/NoteEditService.ts @@ -299,6 +299,10 @@ export class NoteEditService implements OnApplicationShutdown { } if (data.renote) { + if (data.renote.id === oldnote.id) { + throw new Error("A note can't renote itself"); + } + switch (data.renote.visibility) { case 'public': // public noteは無条件にrenote可能 |