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:
parent
4d859a34e7
commit
dc4bb237d4
5 changed files with 10 additions and 11 deletions
|
@ -18,7 +18,7 @@ import React, { ClipboardEvent, createRef, KeyboardEvent } from "react";
|
|||
import EMOJI_REGEX from "emojibase-regex";
|
||||
import { IContent, MatrixEvent, IEventRelation, IMentions } from "matrix-js-sdk/src/models/event";
|
||||
import { DebouncedFunc, throttle } from "lodash";
|
||||
import { EventType, RelationType } from "matrix-js-sdk/src/@types/event";
|
||||
import { EventType, MsgType, RelationType } from "matrix-js-sdk/src/@types/event";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
import { Room } from "matrix-js-sdk/src/models/room";
|
||||
import { Composer as ComposerEvent } from "@matrix-org/analytics-events/types/typescript/Composer";
|
||||
|
@ -187,7 +187,7 @@ export function createMessageContent(
|
|||
const body = textSerialize(model);
|
||||
|
||||
const content: IContent = {
|
||||
msgtype: isEmote ? "m.emote" : "m.text",
|
||||
msgtype: isEmote ? MsgType.Emote : MsgType.Text,
|
||||
body: body,
|
||||
};
|
||||
const formattedBody = htmlSerializeIfNeeded(model, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue