Merge pull request #1965 from matrix-org/t3chguy/show_redacted_sticker

check type before msgtype in the case of `m.sticker` with msgtype
This commit is contained in:
David Baker 2018-06-15 10:56:33 +01:00 committed by GitHub
commit 88a807d89b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -72,10 +72,10 @@ module.exports = React.createClass({
let BodyType = UnknownBody;
if (!this.props.mxEvent.isRedacted()) {
// only resolve BodyType if event is not redacted
if (msgtype && bodyTypes[msgtype]) {
BodyType = bodyTypes[msgtype];
} else if (type && evTypes[type]) {
if (type && evTypes[type]) {
BodyType = evTypes[type];
} else if (msgtype && bodyTypes[msgtype]) {
BodyType = bodyTypes[msgtype];
} else if (content.url) {
// Fallback to MFileBody if there's a content URL
BodyType = bodyTypes['m.file'];