mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2025-01-10 15:40:57 -07:00
[mastodon-client] Don't duplicate RE: for pleroma/akkoma quotes
This commit is contained in:
parent
35c75bbebf
commit
734c6685f7
1 changed files with 7 additions and 5 deletions
|
@ -93,10 +93,12 @@ export class NoteConverter {
|
||||||
return renote.url ?? renote.uri ?? `${config.url}/notes/${renote.id}`;
|
return renote.url ?? renote.uri ?? `${config.url}/notes/${renote.id}`;
|
||||||
});
|
});
|
||||||
|
|
||||||
const content = note.text !== null
|
const text = quoteUri.then(quoteUri => note.text !== null ? quoteUri !== null ? note.text.replaceAll(`RE: ${quoteUri}`, '').replaceAll(quoteUri, '').trimEnd() : note.text : null)
|
||||||
? quoteUri.then(quoteUri => MfmHelpers.toHtml(mfm.parse(note.text!), JSON.parse(note.mentionedRemoteUsers), note.userHost, false, quoteUri)
|
|
||||||
.then(p => p ?? escapeMFM(note.text!)))
|
const content = text.then(text => text !== null
|
||||||
: "";
|
? quoteUri.then(quoteUri => MfmHelpers.toHtml(mfm.parse(text), JSON.parse(note.mentionedRemoteUsers), note.userHost, false, quoteUri))
|
||||||
|
.then(p => p ?? escapeMFM(text))
|
||||||
|
: "");
|
||||||
|
|
||||||
const isPinned = user && note.userId === user.id
|
const isPinned = user && note.userId === user.id
|
||||||
? UserNotePinings.exist({ where: { userId: user.id, noteId: note.id } })
|
? UserNotePinings.exist({ where: { userId: user.id, noteId: note.id } })
|
||||||
|
@ -122,7 +124,7 @@ export class NoteConverter {
|
||||||
reblog: reblog.then(reblog => !isQuote(note) ? reblog : null),
|
reblog: reblog.then(reblog => !isQuote(note) ? reblog : null),
|
||||||
content: content,
|
content: content,
|
||||||
content_type: 'text/x.misskeymarkdown',
|
content_type: 'text/x.misskeymarkdown',
|
||||||
text: note.text,
|
text: text,
|
||||||
created_at: note.createdAt.toISOString(),
|
created_at: note.createdAt.toISOString(),
|
||||||
emojis: noteEmoji,
|
emojis: noteEmoji,
|
||||||
replies_count: note.repliesCount,
|
replies_count: note.repliesCount,
|
||||||
|
|
Loading…
Reference in a new issue