From 575f859bb1a16b5d680789876f156aaf1e4f6c52 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 16 Dec 2017 19:35:56 +0900 Subject: Connection: proactively create a Room object upon joining a room So that clients could start using this object without waiting for the next sync. --- connection.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'connection.cpp') diff --git a/connection.cpp b/connection.cpp index 4fb661f3..06c4dcee 100644 --- a/connection.cpp +++ b/connection.cpp @@ -286,7 +286,10 @@ PostReceiptJob* Connection::postReceipt(Room* room, RoomEvent* event) const JoinRoomJob* Connection::joinRoom(const QString& roomAlias) { - return callApi(roomAlias); + auto job = callApi(roomAlias); + connect(job, &JoinRoomJob::success, + this, [=] { provideRoom(job->roomId(), JoinState::Join); }); + return job; } void Connection::leaveRoom(Room* room) -- cgit v1.2.3