Replace hardcoded strings with MsgType constants (#10604)

* replace hardcoded strings with MsgType constants

* fix import and revert comments

Signed-off-by: Ken Wu kenqiwu@gmail.com

* fix import

Signed-off-by: Ken Wu kenqiwu@gmail.com

---------

Signed-off-by: Ken Wu kenqiwu@gmail.com
This commit is contained in:
kenwuuu 2023-04-17 02:37:29 -07:00 committed by GitHub
parent 4d859a34e7
commit dc4bb237d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 11 deletions

View file

@ -17,6 +17,7 @@ limitations under the License.
import React, { createRef } from "react";
import { EventStatus, IContent, MatrixEvent, MatrixEventEvent } from "matrix-js-sdk/src/models/event";
import classNames from "classnames";
import { MsgType } from "matrix-js-sdk/src/@types/event";
import * as HtmlUtils from "../../../HtmlUtils";
import { editBodyDiffToHtml } from "../../../utils/MessageDiffUtils";
@ -166,7 +167,7 @@ export default class EditHistoryMessage extends React.PureComponent<IProps, ISta
returnString: false,
});
}
if (mxEvent.getContent().msgtype === "m.emote") {
if (mxEvent.getContent().msgtype === MsgType.Emote) {
const name = mxEvent.sender ? mxEvent.sender.name : mxEvent.getSender();
contentContainer = (
<div className="mx_EventTile_content" ref={this.content}>