refactor: prefix Mi for all entities (misskey-dev#11719) (MisskeyIO#160)

cheery-pick from misskey-dev@792622aeadf3e36d50cddec3c64b2ff0105ea927
This commit is contained in:
まっちゃとーにゅ 2023-08-26 08:42:29 +09:00 committed by GitHub
parent 651905e08f
commit 58bbff3738
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
234 changed files with 2061 additions and 2061 deletions

View file

@ -16,11 +16,11 @@ import * as url from '@/misc/prelude/url.js';
import type { Config } from '@/config.js';
import { ApRendererService } from '@/core/activitypub/ApRendererService.js';
import { QueueService } from '@/core/QueueService.js';
import type { LocalUser, RemoteUser, User } from '@/models/entities/User.js';
import type { MiLocalUser, MiRemoteUser, MiUser } from '@/models/entities/User.js';
import { UserKeypairService } from '@/core/UserKeypairService.js';
import type { Following } from '@/models/entities/Following.js';
import type { MiFollowing } from '@/models/entities/Following.js';
import { countIf } from '@/misc/prelude/array.js';
import type { Note } from '@/models/entities/Note.js';
import type { MiNote } from '@/models/entities/Note.js';
import { QueryService } from '@/core/QueryService.js';
import { UtilityService } from '@/core/UtilityService.js';
import { UserEntityService } from '@/core/entities/UserEntityService.js';
@ -87,7 +87,7 @@ export class ActivityPubServerService {
* @param note Note
*/
@bindThis
private async packActivity(note: Note): Promise<any> {
private async packActivity(note: MiNote): Promise<any> {
if (note.renoteId && note.text == null && !note.hasPoll && (note.fileIds == null || note.fileIds.length === 0)) {
const renote = await this.notesRepository.findOneByOrFail({ id: note.renoteId });
return this.apRendererService.renderAnnounce(renote.uri ? renote.uri : `${this.config.url}/notes/${renote.id}`, note);
@ -158,7 +158,7 @@ export class ActivityPubServerService {
if (page) {
const query = {
followeeId: user.id,
} as FindOptionsWhere<Following>;
} as FindOptionsWhere<MiFollowing>;
// カーソルが指定されている場合
if (cursor) {
@ -250,7 +250,7 @@ export class ActivityPubServerService {
if (page) {
const query = {
followerId: user.id,
} as FindOptionsWhere<Following>;
} as FindOptionsWhere<MiFollowing>;
// カーソルが指定されている場合
if (cursor) {
@ -424,7 +424,7 @@ export class ActivityPubServerService {
}
@bindThis
private async userInfo(request: FastifyRequest, reply: FastifyReply, user: User | null) {
private async userInfo(request: FastifyRequest, reply: FastifyReply, user: MiUser | null) {
if (user == null) {
reply.code(404);
return;
@ -432,7 +432,7 @@ export class ActivityPubServerService {
reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.addContext(await this.apRendererService.renderPerson(user as LocalUser)));
return (this.apRendererService.addContext(await this.apRendererService.renderPerson(user as MiLocalUser)));
}
@bindThis
@ -648,7 +648,7 @@ export class ActivityPubServerService {
id: request.params.followee,
host: Not(IsNull()),
}),
]) as [LocalUser | RemoteUser | null, LocalUser | RemoteUser | null];
]) as [MiLocalUser | MiRemoteUser | null, MiLocalUser | MiRemoteUser | null];
if (follower == null || followee == null) {
reply.code(404);
@ -683,7 +683,7 @@ export class ActivityPubServerService {
id: followRequest.followeeId,
host: Not(IsNull()),
}),
]) as [LocalUser | RemoteUser | null, LocalUser | RemoteUser | null];
]) as [MiLocalUser | MiRemoteUser | null, MiLocalUser | MiRemoteUser | null];
if (follower == null || followee == null) {
reply.code(404);