From efcf3efae456cb9a795d64d30338da3d837b4bc0 Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Mon, 4 Jun 2018 23:17:35 -0300 Subject: return event-id when sending from Matrix::Client::Room --- lib/Matrix/Client/Room.pm6 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/Matrix/Client') diff --git a/lib/Matrix/Client/Room.pm6 b/lib/Matrix/Client/Room.pm6 index 1f6aa19..6ba3ff1 100644 --- a/lib/Matrix/Client/Room.pm6 +++ b/lib/Matrix/Client/Room.pm6 @@ -43,7 +43,12 @@ method messages() { method send(Str $body!, Str :$type? = "m.text") { $Matrix::Client::Common::TXN-ID++; - $.put("/send/m.room.message/{$Matrix::Client::Common::TXN-ID}", msgtype => $type, body => $body) + my $res = $.put( + "/send/m.room.message/{$Matrix::Client::Common::TXN-ID}", + msgtype => $type, body => $body + ); + + from-json($res.content) } method leave() { -- cgit v1.2.3-70-g09d2