From 45193624c2732015a508af88134fe9f808570b08 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sat, 15 Feb 2020 12:21:03 +0000 Subject: [PATCH] [Room] Fix internal message type --- lib/src/room.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/room.dart b/lib/src/room.dart index bbc5459..a0c379e 100644 --- a/lib/src/room.dart +++ b/lib/src/room.dart @@ -498,7 +498,8 @@ class Room { Future sendEvent(Map content, {String txid, Event inReplyTo}) async { - final String type = this.encrypted ? "m.room.encrypted" : "m.room.message"; + final String type = "m.room.message"; + final String sendType = this.encrypted ? "m.room.encrypted" : type; // Create new transaction id String messageID; @@ -547,7 +548,7 @@ class Room { try { final Map response = await client.jsonRequest( type: HTTPType.PUT, - action: "/client/r0/rooms/${id}/send/$type/$messageID", + action: "/client/r0/rooms/${id}/send/$sendType/$messageID", data: await encryptGroupMessagePayload(content)); final String res = response["event_id"]; eventUpdate.content["status"] = 1;