Skip to content
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.

Commit

Permalink
Changed to use createTextMessageDTO (heusalagroup/hghs#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
thejhh committed Apr 24, 2022
1 parent 844408d commit ba257aa
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions SimpleMatrixClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { LogService } from "../core/LogService";
import { JsonAny } from "../core/Json";
import { JsonAny as Json, isJsonObject, JsonObject } from "../core/Json";
import { MatrixPasswordLoginDTO } from "./types/request/passwordLogin/MatrixPasswordLoginDTO";
import { MatrixTextMessageDTO } from "./types/message/textMessage/MatrixTextMessageDTO";
import { createMatrixTextMessageDTO, MatrixTextMessageDTO } from "./types/message/textMessage/MatrixTextMessageDTO";
import { MatrixType } from "./types/core/MatrixType";
import { isMatrixLoginResponseDTO } from "./types/response/login/MatrixLoginResponseDTO";
import { MatrixCreateRoomDTO } from "./types/request/createRoom/MatrixCreateRoomDTO";
Expand Down Expand Up @@ -945,11 +945,7 @@ export class SimpleMatrixClient {
throw new TypeError(`sendTextMessage: Client did not have access token`);
}

const requestBody : MatrixTextMessageDTO = {
msgtype: MatrixType.M_TEXT,
body: body
};

const requestBody : MatrixTextMessageDTO = createMatrixTextMessageDTO(body);
LOG.debug(`Sending message with body:`, requestBody);

const response : Json | undefined = await this._postJson(
Expand Down

0 comments on commit ba257aa

Please sign in to comment.