Merge tag '2023.9.0' into merge-upstream

This commit is contained in:
riku6460 2023-09-25 12:43:07 +09:00
commit 87223add7b
No known key found for this signature in database
GPG key ID: 27414FA27DB94CF6
1235 changed files with 19016 additions and 13835 deletions

View file

@ -5,11 +5,12 @@
import { Inject, Injectable } from '@nestjs/common';
import { DI } from '@/di-symbols.js';
import type { MutingsRepository } from '@/models/index.js';
import type { MutingsRepository } from '@/models/_.js';
import { awaitAll } from '@/misc/prelude/await-all.js';
import type { Packed } from '@/misc/json-schema.js';
import type { MiUser } from '@/models/entities/User.js';
import type { MiMuting } from '@/models/entities/Muting.js';
import type { } from '@/models/Blocking.js';
import type { MiUser } from '@/models/User.js';
import type { MiMuting } from '@/models/Muting.js';
import { bindThis } from '@/decorators.js';
import { UserEntityService } from './UserEntityService.js';
@ -26,7 +27,7 @@ export class MutingEntityService {
@bindThis
public async pack(
src: MiMuting['id'] | MiMuting,
me: { id: MiUser['id'] } | null | undefined,
me?: { id: MiUser['id'] } | null | undefined,
): Promise<Packed<'Muting'>> {
const muting = typeof src === 'object' ? src : await this.mutingsRepository.findOneByOrFail({ id: src });
@ -44,7 +45,7 @@ export class MutingEntityService {
@bindThis
public async packMany(
mutings: (MiMuting['id'] | MiMuting)[],
me: { id: MiUser['id'] } | null | undefined,
me: { id: MiUser['id'] },
) : Promise<Packed<'Muting'>[]> {
return (await Promise.allSettled(mutings.map(x => this.pack(x, me))))
.filter(result => result.status === 'fulfilled')