fix some audience parsing assumptions
ci/woodpecker/push/lint-foundkey-js Pipeline was successful Details
ci/woodpecker/push/lint-client Pipeline failed Details
ci/woodpecker/push/lint-backend Pipeline failed Details
ci/woodpecker/push/lint-sw Pipeline failed Details
ci/woodpecker/push/build Pipeline was successful Details
ci/woodpecker/push/test Pipeline failed Details

The assumptions made in the comment is actually wrong. The comment says:
"If value is a string, this means it must have passed through the resolver,
which means it must be public." But this is not true because we do signed
GET requests which means we may well get non-public posts using the
resolver.
This commit is contained in:
Johann150 2023-05-28 23:26:59 +02:00
parent bda8488194
commit 2696c34f6c
Signed by: Johann150
GPG Key ID: 9EE6577A2A06F8F1
1 changed files with 2 additions and 4 deletions

View File

@ -101,10 +101,8 @@ export async function createNote(value: string | IObject, resolver: Resolver, si
// If audience(to,cc) was not specified
if (visibility === 'specified' && visibleUsers.length === 0) {
if (typeof value === 'string') { // 入力がstringならばresolverでGETが発生している
// こちらから匿名GET出来たものならばpublic
visibility = 'public';
}
// TODO derive audience from context (e.g. whose inbox this was in?)
throw new Error('audience not understood');
}
let isTalk = note._misskey_talk && visibility === 'specified';