diff --git a/src/components/views/elements/ReplyThread.js b/src/components/views/elements/ReplyThread.js index 650a3845e3..de6ff46610 100644 --- a/src/components/views/elements/ReplyThread.js +++ b/src/components/views/elements/ReplyThread.js @@ -161,12 +161,56 @@ export default class ReplyThread extends React.Component { if (html) html = this.stripHTMLReply(html); } - html = `
In reply to ` - + `${ev.getSender()}`; - const lines = body.trim().split('\n'); - if (lines.length > 0) { - lines[0] = `<${ev.getSender()}> ${lines[0]}`; - body = lines.map((line) => `> ${line}`).join('\n') + '\n\n'; + const evLink = makeEventPermalink(ev.getRoomId(), ev.getId()); + const userLink = makeUserPermalink(ev.getSender()); + const mxid = ev.getSender(); + + // This fallback contains text that is explicitly EN. + switch (ev.getContent().msgtype) { + case 'm.text': + case 'm.notice': { + html = `
${html || body}
In reply to ${mxid}` + + ``; + const lines = body.trim().split('\n'); + if (lines.length > 0) { + lines[0] = `<${mxid}> ${lines[0]}`; + body = lines.map((line) => `> ${line}`).join('\n') + '\n\n'; + } + break; + } + + case 'm.image': + html = `
${html || body}
In reply to ${mxid}` + + ``; + body = `> <${mxid}> sent an image.\n\n${body}`; + break; + case 'm.video': + html = `
sent an image.
In reply to ${mxid}` + + ``; + body = `> <${mxid}> sent a video.\n\n${body}`; + break; + case 'm.audio': + html = `
sent a video.
In reply to ${mxid}` + + ``; + body = `> <${mxid}> sent an audio file.\n\n${body}`; + break; + case 'm.file': + html = `
sent an audio file.
In reply to ${mxid}` + + ``; + body = `> <${mxid}> sent a file.\n\n${body}`; + break; + case 'm.emote': { + html = `
sent a file.
In reply to * ` + + `${mxid}`; + const lines = body.trim().split('\n'); + if (lines.length > 0) { + lines[0] = `* <${mxid}> ${lines[0]}`; + body = lines.map((line) => `> ${line}`).join('\n') + '\n\n'; + } + break; + } + default: + return null; } return {body, html};
${html || body}