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: norm
GPG key ID: 7123E30E441E80DE

View file

@ -257,7 +257,7 @@ if (props.channel) {
if (props.reply) { if (props.reply) {
visibility = foundkey.minVisibility(props.reply.visibility, visibility); visibility = foundkey.minVisibility(props.reply.visibility, visibility);
if (visibility === 'specified') { if (props.reply.visibility === 'specified') {
os.api('users/show', { os.api('users/show', {
userIds: props.reply.visibleUserIds.filter(uid => uid !== $i.id && uid !== props.reply.userId), userIds: props.reply.visibleUserIds.filter(uid => uid !== $i.id && uid !== props.reply.userId),
}).then(users => { }).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) { if (props.specified) {
visibility = 'specified'; visibility = 'specified';
pushVisibleUser(props.specified); pushVisibleUser(props.specified);