diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-12-16 19:35:56 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-12-16 19:35:56 +0900 |
commit | 575f859bb1a16b5d680789876f156aaf1e4f6c52 (patch) | |
tree | a4384492eba3b160a78748ad7544fb8377d87417 | |
parent | c641563dda852880fb9f8189b83d02a59aabe17a (diff) | |
download | libquotient-575f859bb1a16b5d680789876f156aaf1e4f6c52.tar.gz libquotient-575f859bb1a16b5d680789876f156aaf1e4f6c52.zip |
Connection: proactively create a Room object upon joining a room
So that clients could start using this object without waiting for the next sync.
-rw-r--r-- | connection.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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<JoinRoomJob>(roomAlias); + auto job = callApi<JoinRoomJob>(roomAlias); + connect(job, &JoinRoomJob::success, + this, [=] { provideRoom(job->roomId(), JoinState::Join); }); + return job; } void Connection::leaveRoom(Room* room) |