Compare commits

..

No commits in common. "be36a793cd4e2e779a069f4f531d1789cdfbc0cf" and "8b90c6c04527fc1f747abdedd8bb8657bd5a9843" have entirely different histories.

2 changed files with 14 additions and 11 deletions

View file

@ -35,7 +35,7 @@ export class ApMfmService {
noMisskeyContent = true;
}
const content = this.mfmService.toHtml(parsed, note.mentionedRemoteUsers ? JSON.parse(note.mentionedRemoteUsers) : []);
const content = this.mfmService.toHtml(parsed, JSON.parse(note.mentionedRemoteUsers));
return {
content,

View file

@ -700,15 +700,17 @@ export class ApRendererService {
poll = await this.pollsRepository.findOneBy({ noteId: note.id });
}
let apAppend = '';
let apText = text;
if (quote) {
apAppend += `\n\nRE: ${quote}`;
apText += `\n\nRE: ${quote}`;
}
const summary = note.cw === '' ? String.fromCharCode(0x200B) : note.cw;
const { content, noMisskeyContent } = this.apMfmService.getNoteHtml(note, apAppend);
const content = this.apMfmService.getNoteHtml(Object.assign({}, note, {
text: apText,
}));
const emojis = await this.getEmojis(note.emojis);
const apemojis = emojis.filter(emoji => !emoji.localOnly).map(emoji => this.renderEmoji(emoji));
@ -721,6 +723,9 @@ export class ApRendererService {
const asPoll = poll ? {
type: 'Question',
content: this.apMfmService.getNoteHtml(Object.assign({}, note, {
text: text,
})),
[poll.expiresAt && poll.expiresAt < new Date() ? 'closed' : 'endTime']: poll.expiresAt,
[poll.multiple ? 'anyOf' : 'oneOf']: poll.choices.map((text, i) => ({
type: 'Note',
@ -739,13 +744,11 @@ export class ApRendererService {
summary: summary ?? undefined,
content: content ?? undefined,
updated: note.updatedAt?.toISOString(),
...(noMisskeyContent ? {} : {
_misskey_content: text,
source: {
content: text,
mediaType: 'text/x.misskeymarkdown',
},
}),
_misskey_quote: quote,
quoteUrl: quote,
quoteUri: quote,