From 34ae0794e1f2ee8b77632744902b6ed6ba8bca19 Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 9 Jun 2019 12:42:19 +0000 Subject: [PATCH] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f0045df..4774bd5 100644 --- a/README.md +++ b/README.md @@ -30,19 +30,19 @@ Client matrix = Client("famedly talk"); ```dart matrix.homeserver = "https://yourhomeserveraddress"; -matrix.onLoginStateChanged.stream.listen((bool loginState){ +matrix.connection.onLoginStateChanged.stream.listen((bool loginState){ print("LoginState: ${loginState.toString()}"); }); -matrix.onEvent.stream.listen((EventUpdate eventUpdate){ +matrix.connection.onEvent.stream.listen((EventUpdate eventUpdate){ print("New event update!"); }); -matrix.onRoomUpdate.stream.listen((RoomUpdate eventUpdate){ +matrix.connection.onRoomUpdate.stream.listen((RoomUpdate eventUpdate){ print("New room update!"); }); -final loginResp = await matrix.jsonRequest( +final loginResp = await matrix.connection.jsonRequest( type: "POST", action: "/client/r0/login", data: { @@ -53,7 +53,7 @@ final loginResp = await matrix.jsonRequest( } ); -matrix.connect( +matrix.connection.connect( newToken: loginResp["token"], newUserID: loginResp["user_id"], newHomeserver: matrix.homeserver, @@ -67,7 +67,7 @@ matrix.connect( 4. Send a message to a Room: ```dart -final resp = await jsonRequest( +final resp = await matrix.connection.jsonRequest( type: "PUT", action: "/r0/rooms/!fjd823j:example.com/send/m.room.message/$txnId", data: {