From ba05f236bd9588b2f780d8d3e95117a59891b671 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 10 Sep 2018 02:47:34 +0900 Subject: [PATCH] Resolve #2101 --- src/remote/activitypub/models/note.ts | 2 +- src/remote/activitypub/renderer/note.ts | 1 + src/remote/activitypub/type.ts | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/remote/activitypub/models/note.ts b/src/remote/activitypub/models/note.ts index 97188b44a..b4afda765 100644 --- a/src/remote/activitypub/models/note.ts +++ b/src/remote/activitypub/models/note.ts @@ -91,7 +91,7 @@ export async function createNote(value: any, resolver?: Resolver, silent = false const reply = note.inReplyTo ? await resolveNote(note.inReplyTo, resolver) : null; // テキストのパース - const text = htmlToMFM(note.content); + const text = note._misskey_content ? note._misskey_content : htmlToMFM(note.content); // ユーザーの情報が古かったらついでに更新しておく if (actor.updatedAt == null || Date.now() - actor.updatedAt.getTime() > 1000 * 60 * 60 * 24) { diff --git a/src/remote/activitypub/renderer/note.ts b/src/remote/activitypub/renderer/note.ts index 6b30324ae..04e131637 100644 --- a/src/remote/activitypub/renderer/note.ts +++ b/src/remote/activitypub/renderer/note.ts @@ -87,6 +87,7 @@ export default async function renderNote(note: INote, dive = true): Promise attributedTo, summary: note.cw, content: toHtml(note), + _misskey_content_: note.text, published: note.createdAt.toISOString(), to, cc, diff --git a/src/remote/activitypub/type.ts b/src/remote/activitypub/type.ts index 3d40ad48c..28763d3e8 100644 --- a/src/remote/activitypub/type.ts +++ b/src/remote/activitypub/type.ts @@ -40,6 +40,7 @@ export interface IOrderedCollection extends IObject { export interface INote extends IObject { type: 'Note'; + _misskey_content: string; } export interface IPerson extends IObject {