Skip to content
Snippets Groups Projects
Commit f2b1cf92 authored by MeiMei's avatar MeiMei Committed by syuilo
Browse files

AP CW (#3448)

parent 3db414ad
No related branches found
No related tags found
No related merge requests found
......@@ -103,6 +103,8 @@ export async function createNote(value: any, resolver?: Resolver, silent = false
quote = await resolveNote(note._misskey_quote).catch(() => null);
}
const cw = note.summary === '' ? null : note.summary;
// テキストのパース
const text = note._misskey_content ? note._misskey_content : htmlToMFM(note.content);
......@@ -120,7 +122,7 @@ export async function createNote(value: any, resolver?: Resolver, silent = false
files: files,
reply,
renote: quote,
cw: note.summary,
cw: cw,
text: text,
viaMobile: false,
localOnly: false,
......
......@@ -106,6 +106,8 @@ export default async function renderNote(note: INote, dive = true): Promise<any>
text += `\n\nRE: ${url}`;
}
const summary = note.cw === '' ? String.fromCharCode(0x200B) : note.cw;
const content = toHtml(Object.assign({}, note, { text }));
const emojis = await getEmojis(note.emojis);
......@@ -121,7 +123,7 @@ export default async function renderNote(note: INote, dive = true): Promise<any>
id: `${config.url}/notes/${note._id}`,
type: 'Note',
attributedTo,
summary: note.cw,
summary,
content,
_misskey_content: text,
_misskey_quote: quote,
......
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