translate comments
This commit is contained in:
parent
bc841ec965
commit
9d288c0613
2 changed files with 10 additions and 5 deletions
|
@ -319,9 +319,14 @@ export async function resolveNote(value: string | IObject, resolver: Resolver):
|
|||
throw new StatusError('cannot resolve local note', 400, 'cannot resolve local note');
|
||||
}
|
||||
|
||||
// リモートサーバーからフェッチしてきて登録
|
||||
// ここでuriの代わりに添付されてきたNote Objectが指定されていると、サーバーフェッチを経ずにノートが生成されるが
|
||||
// 添付されてきたNote Objectは偽装されている可能性があるため、常にuriを指定してサーバーフェッチを行う。
|
||||
/*
|
||||
If the Note Object attached is specified here instead of uri
|
||||
after fetching from a remote server and registering, the note is
|
||||
generated without going through server fetch, but the attached
|
||||
Note Object may be spoofed, so always specify uri for server
|
||||
Therefore, server fetching is always performed by specifying uri.
|
||||
*/
|
||||
|
||||
return await createNote(uri, resolver, true);
|
||||
} finally {
|
||||
unlock();
|
||||
|
|
|
@ -459,7 +459,7 @@ async function updateFeatured(userId: User['id'], resolver: Resolver) {
|
|||
const unresolvedItems = isCollection(collection) ? collection.items : collection.orderedItems;
|
||||
const items = await Promise.all(toArray(unresolvedItems).map(x => resolver.resolve(x)));
|
||||
|
||||
// Resolve and regist Notes
|
||||
// Resolve and register Notes
|
||||
const limit = promiseLimit<Note | null>(2);
|
||||
const featuredNotes = await Promise.all(items
|
||||
.filter(item => getApType(item) === 'Note') // TODO: Noteでなくてもいいかも
|
||||
|
@ -469,7 +469,7 @@ async function updateFeatured(userId: User['id'], resolver: Resolver) {
|
|||
await db.transaction(async transactionalEntityManager => {
|
||||
await transactionalEntityManager.delete(UserNotePining, { userId: user.id });
|
||||
|
||||
// とりあえずidを別の時間で生成して順番を維持
|
||||
// TODO: For now, generate the id at a different time and maintain the order.
|
||||
let td = 0;
|
||||
for (const note of featuredNotes.filter(note => note != null)) {
|
||||
td -= 1000;
|
||||
|
|
Loading…
Reference in a new issue