1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-13 23:41:50 +03:00

Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into export-conversations

This commit is contained in:
Jaiwanth
2021-07-19 12:57:27 +05:30
208 changed files with 5158 additions and 2854 deletions

View File

@ -42,7 +42,7 @@ export default class MessageEvent extends React.Component {
onHeightChanged: PropTypes.func,
/* the shape of the tile, used */
tileShape: PropTypes.string,
tileShape: PropTypes.string, // TODO: Use TileShape enum
/* to set source to local file path during export */
forExport: PropTypes.bool,
@ -50,6 +50,10 @@ export default class MessageEvent extends React.Component {
/* the maximum image height to use, if the event is an image */
maxImageHeight: PropTypes.number,
/* overrides for the msgtype-specific components, used by ReplyTile to override file rendering */
overrideBodyTypes: PropTypes.object,
overrideEventTypes: PropTypes.object,
/* the permalinkCreator */
permalinkCreator: PropTypes.object,
};
@ -77,9 +81,12 @@ export default class MessageEvent extends React.Component {
'm.file': sdk.getComponent('messages.MFileBody'),
'm.audio': sdk.getComponent('messages.MVoiceOrAudioBody'),
'm.video': sdk.getComponent('messages.MVideoBody'),
...(this.props.overrideBodyTypes || {}),
};
const evTypes = {
'm.sticker': sdk.getComponent('messages.MStickerBody'),
...(this.props.overrideEventTypes || {}),
};
const content = this.props.mxEvent.getContent();
@ -116,7 +123,7 @@ export default class MessageEvent extends React.Component {
}
}
return <BodyType
return BodyType ? <BodyType
ref={this._body}
mxEvent={this.props.mxEvent}
highlights={this.props.highlights}
@ -130,6 +137,6 @@ export default class MessageEvent extends React.Component {
onHeightChanged={this.props.onHeightChanged}
onMessageAllowed={this.onTileUpdate}
permalinkCreator={this.props.permalinkCreator}
/>;
/> : null;
}
}