From 834f72704a023b042a98001af31a9064e07d3c4f Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Mon, 16 Dec 2019 11:55:13 +0000 Subject: [PATCH] =?UTF-8?q?[Room]=C2=A0Add=20sendTypingInfo=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/Room.dart | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/src/Room.dart b/lib/src/Room.dart index cacdd89d..26a4a14c 100644 --- a/lib/src/Room.dart +++ b/lib/src/Room.dart @@ -974,6 +974,18 @@ class Room { data: data); return resp; } + + Future sendTypingInfo(bool isTyping, {int timeout}) { + Map data = { + "typing": isTyping, + }; + if (timeout != null) data["timeout"] = timeout; + return client.connection.jsonRequest( + type: HTTPType.PUT, + action: "/client/r0/rooms/${this.id}/typing/${client.userID}", + data: data, + ); + } } enum PushRuleState { notify, mentions_only, dont_notify }