mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-04 18:24:50 +01:00
AP CW (#3448)
This commit is contained in:
parent
3db414add4
commit
f2b1cf92e1
2 changed files with 6 additions and 2 deletions
|
@ -103,6 +103,8 @@ export async function createNote(value: any, resolver?: Resolver, silent = false
|
||||||
quote = await resolveNote(note._misskey_quote).catch(() => null);
|
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);
|
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,
|
files: files,
|
||||||
reply,
|
reply,
|
||||||
renote: quote,
|
renote: quote,
|
||||||
cw: note.summary,
|
cw: cw,
|
||||||
text: text,
|
text: text,
|
||||||
viaMobile: false,
|
viaMobile: false,
|
||||||
localOnly: false,
|
localOnly: false,
|
||||||
|
|
|
@ -106,6 +106,8 @@ export default async function renderNote(note: INote, dive = true): Promise<any>
|
||||||
text += `\n\nRE: ${url}`;
|
text += `\n\nRE: ${url}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const summary = note.cw === '' ? String.fromCharCode(0x200B) : note.cw;
|
||||||
|
|
||||||
const content = toHtml(Object.assign({}, note, { text }));
|
const content = toHtml(Object.assign({}, note, { text }));
|
||||||
|
|
||||||
const emojis = await getEmojis(note.emojis);
|
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}`,
|
id: `${config.url}/notes/${note._id}`,
|
||||||
type: 'Note',
|
type: 'Note',
|
||||||
attributedTo,
|
attributedTo,
|
||||||
summary: note.cw,
|
summary,
|
||||||
content,
|
content,
|
||||||
_misskey_content: text,
|
_misskey_content: text,
|
||||||
_misskey_quote: quote,
|
_misskey_quote: quote,
|
||||||
|
|
Loading…
Reference in a new issue