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

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

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';