From 9fcf94b1973f376400b05eaabf0e2ffcf25e296b Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Sat, 11 Apr 2020 18:27:58 +0900 Subject: [PATCH] Fix url type of AP object #6231 (#6234) --- src/remote/activitypub/models/note.ts | 4 ++-- src/remote/activitypub/models/person.ts | 6 +++--- src/remote/activitypub/type.ts | 13 ++++++++++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/remote/activitypub/models/note.ts b/src/remote/activitypub/models/note.ts index a149660ccb..1556307670 100644 --- a/src/remote/activitypub/models/note.ts +++ b/src/remote/activitypub/models/note.ts @@ -17,7 +17,7 @@ import { deliverQuestionUpdate } from '../../../services/note/polls/update'; import { extractDbHost, toPuny } from '../../../misc/convert-host'; import { Notes, Emojis, Polls, MessagingMessages } from '../../../models'; import { Note } from '../../../models/entities/note'; -import { IObject, getOneApId, getApId, validPost, IPost, isEmoji } from '../type'; +import { IObject, getOneApId, getApId, getOneApHrefNullable, validPost, IPost, isEmoji } from '../type'; import { Emoji } from '../../../models/entities/emoji'; import { genId } from '../../../misc/gen-id'; import { fetchMeta } from '../../../misc/fetch-meta'; @@ -282,7 +282,7 @@ export async function createNote(value: string | IObject, resolver?: Resolver, s apEmojis, poll, uri: note.id, - url: note.url, + url: getOneApHrefNullable(note.url), }, silent); } diff --git a/src/remote/activitypub/models/person.ts b/src/remote/activitypub/models/person.ts index 80ba6b514a..91b1c5cd60 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, getApId, IObject, isPropertyValue, IApPropertyValue } from '../type'; +import { isCollectionOrOrderedCollection, isCollection, IPerson, getApId, getOneApHrefNullable, IObject, isPropertyValue, IApPropertyValue } from '../type'; import { fromHtml } from '../../../mfm/fromHtml'; import { htmlToMfm } from '../misc/html-to-mfm'; import { resolveNote, extractEmojis } from './note'; @@ -166,7 +166,7 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise