From 71a12b6bbbe2cb0e383d7e75a49d32c8e7c17989 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 3 May 2018 11:23:41 +0100 Subject: [PATCH 1/2] fix getDefaultProps mixup Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/rooms/EventTile.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index c7150da67c..bfcf8ac9d4 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -155,9 +155,11 @@ module.exports = withMatrixClient(React.createClass({ isTwelveHour: PropTypes.bool, }, - defaultProps: { - // no-op function because onWidgetLoad is optional yet some subcomponents assume its existence - onWidgetLoad: function() {}, + getDefaultProps: function() { + return { + // no-op function because onWidgetLoad is optional yet some sub-components assume its existence + onWidgetLoad: function() {}, + }; }, getInitialState: function() { From 4892694e770cb5dea68aea4f19e76f2fd835260e Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 3 May 2018 11:24:10 +0100 Subject: [PATCH 2/2] use more explicit reply fallback closing tag construct to fix 6657 Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/elements/ReplyThread.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/views/elements/ReplyThread.js b/src/components/views/elements/ReplyThread.js index 138431259f..c7ca4b2d41 100644 --- a/src/components/views/elements/ReplyThread.js +++ b/src/components/views/elements/ReplyThread.js @@ -97,7 +97,7 @@ export default class ReplyThread extends React.Component { // Part of Replies fallback support static stripHTMLReply(html) { - return html.replace(/^
[\s\S]+?<\/blockquote>/, ''); + return html.replace(/^`; body = `> <${mxid}> sent an image.\n\n`; break; case 'm.video': html = `[\s\S]+?<\/blockquote>/, ''); } // Part of Replies fallback support @@ -119,7 +119,7 @@ export default class ReplyThread extends React.Component { case 'm.text': case 'm.notice': { html = ``; const lines = body.trim().split('\n'); if (lines.length > 0) { lines[0] = `<${mxid}> ${lines[0]}`; @@ -129,27 +129,27 @@ export default class ReplyThread extends React.Component { } case 'm.image': html = `In reply to ${mxid}` - + ``; + + `
${html || body}
${html || body}In reply to ${mxid}` - + ``; + + `
sent an image.
sent an image.
In reply to ${mxid}` - + ``; + + `
sent a video.
In reply to ${mxid}` - + ``; + + `
sent an audio file.
In reply to ${mxid}` - + ``; + + `
sent a file.
In reply to * ` - + `${mxid}`; + + `${mxid}
${html || body}