mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 15:00:30 +03:00
Refectored Message comp
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
f628a6c3d6
commit
7e7a5e692e
11 changed files with 453 additions and 530 deletions
|
|
@ -95,13 +95,13 @@ function getFormattedBody(markdown) {
|
|||
function getReplyFormattedBody(roomId, reply) {
|
||||
const replyToLink = `<a href="https://matrix.to/#/${roomId}/${reply.eventId}">In reply to</a>`;
|
||||
const userLink = `<a href="https://matrix.to/#/${reply.userId}">${reply.userId}</a>`;
|
||||
const formattedReply = getFormattedBody(reply.content.replaceAll('\n', '\n> '));
|
||||
const formattedReply = getFormattedBody(reply.body.replaceAll('\n', '\n> '));
|
||||
return `<mx-reply><blockquote>${replyToLink}${userLink}<br />${formattedReply}</blockquote></mx-reply>`;
|
||||
}
|
||||
|
||||
function bindReplyToContent(roomId, reply, content) {
|
||||
const newContent = { ...content };
|
||||
newContent.body = `> <${reply.userId}> ${reply.content.replaceAll('\n', '\n> ')}`;
|
||||
newContent.body = `> <${reply.userId}> ${reply.body.replaceAll('\n', '\n> ')}`;
|
||||
newContent.body += `\n\n${content.body}`;
|
||||
newContent.format = 'org.matrix.custom.html';
|
||||
newContent['m.relates_to'] = content['m.relates_to'] || {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue