diff --git a/src/remote/activitypub/misc/get-note-html.ts b/src/remote/activitypub/misc/get-note-html.ts index f92e91c34..0a607bd48 100644 --- a/src/remote/activitypub/misc/get-note-html.ts +++ b/src/remote/activitypub/misc/get-note-html.ts @@ -1,22 +1,10 @@ import { INote } from '../../../models/note'; import toHtml from '../../../mfm/html'; import parse from '../../../mfm/parse'; -import config from '../../../config'; export default function(note: INote) { let html = toHtml(parse(note.text), note.mentionedRemoteUsers); if (html == null) html = ''; - if (note.poll != null) { - const url = `${config.url}/notes/${note._id}`; - // TODO: i18n - html += `

【Misskeyで投票を見る】

`; - } - - if (note.renoteId != null) { - const url = `${config.url}/notes/${note.renoteId}`; - html += `

RE: ${url}

`; - } - return html; } diff --git a/src/remote/activitypub/renderer/note.ts b/src/remote/activitypub/renderer/note.ts index 5d28e5f45..3ed6a6e16 100644 --- a/src/remote/activitypub/renderer/note.ts +++ b/src/remote/activitypub/renderer/note.ts @@ -82,6 +82,20 @@ export default async function renderNote(note: INote, dive = true): Promise const files = await promisedFiles; + if (note.poll != null) { + if (note.text == null) note.text = ''; + const url = `${config.url}/notes/${note._id}`; + // TODO: i18n + note.text += `\n\n[投票を見る](${url})`; + } + + if (note.renoteId != null) { + if (note.text == null) note.text = ''; + const url = `${config.url}/notes/${note.renoteId}`; + note.text += `\n\nRE: ${url}`; + } + + // 省略されたメンションのホストを復元する const text = note.text ? parseMfm(note.text).map(x => { if (x.type == 'mention' && x.host == null) { return `${x.content}@${config.host}`;