1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-12-12 05:38:12 +09:00
This commit is contained in:
MeiMei 2019-10-28 20:34:01 +09:00 committed by syuilo
parent 7a94117d90
commit 4f2b4366f2
2 changed files with 19 additions and 14 deletions

View File

@ -3,7 +3,7 @@ import * as promiseLimit from 'promise-limit';
import config from '../../../config';
import Resolver from '../resolver';
import { resolveImage } from './image';
import { isCollectionOrOrderedCollection, isCollection, IPerson } from '../type';
import { isCollectionOrOrderedCollection, isCollection, IPerson, getApId } from '../type';
import { DriveFile } from '../../../models/entities/drive-file';
import { fromHtml } from '../../../mfm/fromHtml';
import { resolveNote, extractEmojis } from './note';
@ -152,11 +152,11 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise<Us
name: person.name,
isLocked: !!person.manuallyApprovesFollowers,
username: person.preferredUsername,
usernameLower: person.preferredUsername.toLowerCase(),
usernameLower: person.preferredUsername!.toLowerCase(),
host,
inbox: person.inbox,
sharedInbox: person.sharedInbox || (person.endpoints ? person.endpoints.sharedInbox : undefined),
featured: person.featured,
featured: person.featured ? getApId(person.featured) : undefined,
uri: person.id,
tags,
isBot,

View File

@ -100,17 +100,22 @@ export const validActor = ['Person', 'Service'];
export interface IPerson extends IObject {
type: 'Person';
name: string;
preferredUsername: string;
manuallyApprovesFollowers: boolean;
inbox: string;
sharedInbox?: string;
publicKey: any;
followers: any;
following: any;
featured?: any;
outbox: any;
endpoints: any;
name?: string;
preferredUsername?: string;
manuallyApprovesFollowers?: boolean;
inbox?: string;
sharedInbox?: string; // 後方互換性のため
publicKey: {
id: string;
publicKeyPem: string;
};
followers?: string | ICollection | IOrderedCollection;
following?: string | ICollection | IOrderedCollection;
featured?: string | IOrderedCollection;
outbox?: string | IOrderedCollection;
endpoints?: {
sharedInbox?: string;
};
}
export const isCollection = (object: IObject): object is ICollection =>