refactor: prefix Mi for all entities (#11719)
* wip
* wip
* wip
* wip
* Update RepositoryModule.ts
* wip
* wip
* wip
* Revert "wip"
This reverts commit c1c13b37d2
.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user