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()}
${html || body}
`; - 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 = `
In reply to ${mxid}` + + `
${html || body}
`; + 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 = `
In reply to ${mxid}` + + `
sent an image.
`; + body = `> <${mxid}> sent an image.\n\n${body}`; + break; + case 'm.video': + html = `
In reply to ${mxid}` + + `
sent a video.
`; + body = `> <${mxid}> sent a video.\n\n${body}`; + break; + case 'm.audio': + html = `
In reply to ${mxid}` + + `
sent an audio file.
`; + body = `> <${mxid}> sent an audio file.\n\n${body}`; + break; + case 'm.file': + html = `
In reply to ${mxid}` + + `
sent a file.
`; + body = `> <${mxid}> sent a file.\n\n${body}`; + break; + case 'm.emote': { + html = `
In reply to * ` + + `${mxid}
${html || body}
`; + 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};