diff options
| author | Laura Hausmann <laura@hausmann.dev> | 2022-12-02 22:14:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-03 06:14:37 +0900 |
| commit | 2037c83541f28f22c072d61fce7096c13e97d845 (patch) | |
| tree | 2a89fc8050debbe3aa57bff3820f6f852ed9071c /packages/client/src | |
| parent | fix(server): "forkbomb" DOS mitigation (#9247) (diff) | |
| download | misskey-2037c83541f28f22c072d61fce7096c13e97d845.tar.gz misskey-2037c83541f28f22c072d61fce7096c13e97d845.tar.bz2 misskey-2037c83541f28f22c072d61fce7096c13e97d845.zip | |
fix(client): make note visibility inheritance behave correctly when default is set to followers-only (#9238)
* Fix post visibility
* Also in the case of specified
* fix
Co-authored-by: tamaina <tamaina@hotmail.co.jp>
Diffstat (limited to 'packages/client/src')
| -rw-r--r-- | packages/client/src/components/MkPostForm.vue | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/packages/client/src/components/MkPostForm.vue b/packages/client/src/components/MkPostForm.vue index 24f2bfb9e6..4b7730d5d5 100644 --- a/packages/client/src/components/MkPostForm.vue +++ b/packages/client/src/components/MkPostForm.vue @@ -262,13 +262,22 @@ if (props.channel) { // 公開以外へのリプライ時は元の公開範囲を引き継ぐ if (props.reply && ['home', 'followers', 'specified'].includes(props.reply.visibility)) { - visibility = props.reply.visibility; - if (props.reply.visibility === 'specified') { - os.api('users/show', { - userIds: props.reply.visibleUserIds.filter(uid => uid !== $i.id && uid !== props.reply.userId), - }).then(users => { - users.forEach(pushVisibleUser); - }); + if (props.reply.visibility === 'home' && visibility === 'followers') { + visibility = 'followers'; + } else if (['home', 'followers'].includes(props.reply.visibility) && visibility === 'specified') { + visibility = 'specified'; + } else { + visibility = props.reply.visibility; + } + + if (visibility === 'specified') { + if (props.reply.visibleUserIds) { + os.api('users/show', { + userIds: props.reply.visibleUserIds.filter(uid => uid !== $i.id && uid !== props.reply.userId), + }).then(users => { + users.forEach(pushVisibleUser); + }); + } if (props.reply.userId !== $i.id) { os.api('users/show', { userId: props.reply.userId }).then(user => { |