Skip to content
Snippets Groups Projects
Unverified Commit b21b3383 authored by syuilo's avatar syuilo
Browse files

Fix bug

parent 020cc471
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ import DriveFile, { IDriveFile } from '../../../models/drive-file';
import Note, { INote } from '../../../models/note';
import User from '../../../models/user';
import toHtml from '../misc/get-note-html';
import parseMfm from '../../../mfm/parse';
export default async function renderNote(note: INote, dive = true): Promise<any> {
const promisedFiles: Promise<IDriveFile[]> = note.fileIds
......@@ -81,13 +82,21 @@ export default async function renderNote(note: INote, dive = true): Promise<any>
const files = await promisedFiles;
const text = note.text ? parseMfm(note.text).map(x => {
if (x.type == 'mention' && x.host == null) {
return `${x.content}@${config.host}`;
} else {
return x.content;
}
}).join('') : null;
return {
id: `${config.url}/notes/${note._id}`,
type: 'Note',
attributedTo,
summary: note.cw,
content: toHtml(note),
_misskey_content: note.text,
_misskey_content: text,
published: note.createdAt.toISOString(),
to,
cc,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment