diff options
| author | Marie <github@yuugi.dev> | 2024-10-03 17:45:26 +0000 |
|---|---|---|
| committer | Marie <github@yuugi.dev> | 2024-10-03 17:45:26 +0000 |
| commit | f6e0a040537562c35f176c2a2fcefc3552deb0f3 (patch) | |
| tree | 1be82b4010ae044ddb8457a251dfaefce17bdc6a /packages/backend/src/core | |
| parent | merge: fix #332 - classic view navbar now respects "side (icon only)" (!630) (diff) | |
| parent | fix linting (diff) | |
| download | sharkey-f6e0a040537562c35f176c2a2fcefc3552deb0f3.tar.gz sharkey-f6e0a040537562c35f176c2a2fcefc3552deb0f3.tar.bz2 sharkey-f6e0a040537562c35f176c2a2fcefc3552deb0f3.zip | |
merge: maybe fix #510 - try to not edit visibility (!631)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/631
Closes #510
Approved-by: fEmber <acomputerdog@gmail.com>
Approved-by: Marie <github@yuugi.dev>
Diffstat (limited to 'packages/backend/src/core')
| -rw-r--r-- | packages/backend/src/core/NoteEditService.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/backend/src/core/NoteEditService.ts b/packages/backend/src/core/NoteEditService.ts index 5ff0f26e2b..f42d14b466 100644 --- a/packages/backend/src/core/NoteEditService.ts +++ b/packages/backend/src/core/NoteEditService.ts @@ -247,6 +247,11 @@ export class NoteEditService implements OnApplicationShutdown { data.reply = undefined; } + // changing visibility on an edit is ill-defined, let's try to + // keep the same visibility as the original note + data.visibility = oldnote.visibility; + data.localOnly = oldnote.localOnly; + // チャンネル外にリプライしたら対象のスコープに合わせる // (クライアントサイドでやっても良い処理だと思うけどとりあえずサーバーサイドで) if (data.reply && data.channel && data.reply.channelId !== data.channel.id) { @@ -429,9 +434,6 @@ export class NoteEditService implements OnApplicationShutdown { if (data.cw !== oldnote.cw) { update.cw = data.cw; } - if (data.localOnly !== oldnote.localOnly) { - update.localOnly = data.localOnly; - } if (oldnote.hasPoll !== !!data.poll) { update.hasPoll = !!data.poll; } |