client: include renote in visibility computation

Changelog: Changed
This commit is contained in:
Johann150 2022-09-14 22:56:53 +02:00 committed by Francis Dinh
parent 17fa488eb9
commit 106e14700f
Signed by untrusted user: norm
GPG key ID: 7123E30E441E80DE

View file

@ -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);