refactor: prefix Mi for all entities (misskey-dev#11719) (MisskeyIO#160)
cheery-pick from misskey-dev@792622aeadf3e36d50cddec3c64b2ff0105ea927
This commit is contained in:
parent
651905e08f
commit
58bbff3738
234 changed files with 2061 additions and 2061 deletions
|
|
@ -8,30 +8,30 @@ import { DI } from '@/di-symbols.js';
|
|||
import type { FollowingsRepository } from '@/models/index.js';
|
||||
import { awaitAll } from '@/misc/prelude/await-all.js';
|
||||
import type { Packed } from '@/misc/json-schema.js';
|
||||
import type { User } from '@/models/entities/User.js';
|
||||
import type { Following } from '@/models/entities/Following.js';
|
||||
import type { MiUser } from '@/models/entities/User.js';
|
||||
import type { MiFollowing } from '@/models/entities/Following.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { UserEntityService } from './UserEntityService.js';
|
||||
|
||||
type LocalFollowerFollowing = Following & {
|
||||
type LocalFollowerFollowing = MiFollowing & {
|
||||
followerHost: null;
|
||||
followerInbox: null;
|
||||
followerSharedInbox: null;
|
||||
};
|
||||
|
||||
type RemoteFollowerFollowing = Following & {
|
||||
type RemoteFollowerFollowing = MiFollowing & {
|
||||
followerHost: string;
|
||||
followerInbox: string;
|
||||
followerSharedInbox: string;
|
||||
};
|
||||
|
||||
type LocalFolloweeFollowing = Following & {
|
||||
type LocalFolloweeFollowing = MiFollowing & {
|
||||
followeeHost: null;
|
||||
followeeInbox: null;
|
||||
followeeSharedInbox: null;
|
||||
};
|
||||
|
||||
type RemoteFolloweeFollowing = Following & {
|
||||
type RemoteFolloweeFollowing = MiFollowing & {
|
||||
followeeHost: string;
|
||||
followeeInbox: string;
|
||||
followeeSharedInbox: string;
|
||||
|
|
@ -48,29 +48,29 @@ export class FollowingEntityService {
|
|||
}
|
||||
|
||||
@bindThis
|
||||
public isLocalFollower(following: Following): following is LocalFollowerFollowing {
|
||||
public isLocalFollower(following: MiFollowing): following is LocalFollowerFollowing {
|
||||
return following.followerHost == null;
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public isRemoteFollower(following: Following): following is RemoteFollowerFollowing {
|
||||
public isRemoteFollower(following: MiFollowing): following is RemoteFollowerFollowing {
|
||||
return following.followerHost != null;
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public isLocalFollowee(following: Following): following is LocalFolloweeFollowing {
|
||||
public isLocalFollowee(following: MiFollowing): following is LocalFolloweeFollowing {
|
||||
return following.followeeHost == null;
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public isRemoteFollowee(following: Following): following is RemoteFolloweeFollowing {
|
||||
public isRemoteFollowee(following: MiFollowing): following is RemoteFolloweeFollowing {
|
||||
return following.followeeHost != null;
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public async pack(
|
||||
src: Following['id'] | Following,
|
||||
me: { id: User['id'] } | null | undefined,
|
||||
src: MiFollowing['id'] | MiFollowing,
|
||||
me: { id: MiUser['id'] } | null | undefined,
|
||||
opts?: {
|
||||
populateFollowee?: boolean;
|
||||
populateFollower?: boolean;
|
||||
|
|
@ -96,8 +96,8 @@ export class FollowingEntityService {
|
|||
|
||||
@bindThis
|
||||
public async packMany(
|
||||
followings: (Following['id'] | Following)[],
|
||||
me: { id: User['id'] } | null | undefined,
|
||||
followings: (MiFollowing['id'] | MiFollowing)[],
|
||||
me: { id: MiUser['id'] } | null | undefined,
|
||||
opts?: {
|
||||
populateFollowee?: boolean;
|
||||
populateFollower?: boolean;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue