summaryrefslogtreecommitdiff
path: root/src/remote/activitypub
diff options
context:
space:
mode:
authorMeiMei <30769358+mei23@users.noreply.github.com>2019-10-28 20:34:01 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2019-10-28 20:34:01 +0900
commit4f2b4366f2f2ed84b8308abeb87eb83ba34aa99e (patch)
tree6f4fb59ba3a7a0e53774ae85addce477dd2fb2f3 /src/remote/activitypub
parentUpdate README.md [AUTOGEN] (#5553) (diff)
downloadsharkey-4f2b4366f2f2ed84b8308abeb87eb83ba34aa99e.tar.gz
sharkey-4f2b4366f2f2ed84b8308abeb87eb83ba34aa99e.tar.bz2
sharkey-4f2b4366f2f2ed84b8308abeb87eb83ba34aa99e.zip
Fix #5539 (#5542)
Diffstat (limited to 'src/remote/activitypub')
-rw-r--r--src/remote/activitypub/models/person.ts6
-rw-r--r--src/remote/activitypub/type.ts27
2 files changed, 19 insertions, 14 deletions
diff --git a/src/remote/activitypub/models/person.ts b/src/remote/activitypub/models/person.ts
index 09db5e1aed..198fd78bd5 100644
--- a/src/remote/activitypub/models/person.ts
+++ b/src/remote/activitypub/models/person.ts
@@ -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,
diff --git a/src/remote/activitypub/type.ts b/src/remote/activitypub/type.ts
index 62475faefc..df9da42fa8 100644
--- a/src/remote/activitypub/type.ts
+++ b/src/remote/activitypub/type.ts
@@ -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 =>