From 106e14700ff56ab5c86b1ec304503901f1bebf91 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Wed, 14 Sep 2022 22:56:53 +0200 Subject: [PATCH] client: include renote in visibility computation Changelog: Changed --- packages/client/src/components/post-form.vue | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/post-form.vue b/packages/client/src/components/post-form.vue index 3bae9ba57..3340f22ae 100644 --- a/packages/client/src/components/post-form.vue +++ b/packages/client/src/components/post-form.vue @@ -257,7 +257,7 @@ if (props.channel) { if (props.reply) { visibility = foundkey.minVisibility(props.reply.visibility, visibility); - if (visibility === 'specified') { + if (props.reply.visibility === 'specified') { os.api('users/show', { userIds: props.reply.visibleUserIds.filter(uid => uid !== $i.id && uid !== props.reply.userId), }).then(users => { @@ -272,6 +272,23 @@ if (props.reply) { } } +if (props.renote) { + visibility = foundkey.minVisibility(props.renote.visibility, visibility); + if (props.renote.visibility === 'specified') { + os.api('users/show', { + userIds: props.renote.visibleUserIds.filter(uid => uid !== $i.id && uid !== props.renote.userId), + }).then(users => { + users.forEach(pushVisibleUser); + }); + + if (props.renote.userId !== $i.id) { + os.api('users/show', { userId: props.renote.userId }).then(user => { + pushVisibleUser(user); + }); + } + } +} + if (props.specified) { visibility = 'specified'; pushVisibleUser(props.specified);