From 7c7ce3d468af242364efb53e77ed12047b6a5382 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 29 Oct 2018 12:10:14 +0900 Subject: Connection::joinRoom: allow to specify intermediate servers Closes #127. --- lib/connection.cpp | 5 +++-- lib/connection.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/connection.cpp b/lib/connection.cpp index 3d635a7e..df9fb112 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -422,9 +422,10 @@ PostReceiptJob* Connection::postReceipt(Room* room, RoomEvent* event) const return callApi(room->id(), "m.read", event->id()); } -JoinRoomJob* Connection::joinRoom(const QString& roomAlias) +JoinRoomJob* Connection::joinRoom(const QString& roomAlias, + const QStringList& serverNames) { - auto job = callApi(roomAlias); + auto job = callApi(roomAlias, serverNames); connect(job, &JoinRoomJob::success, this, [this, job] { provideRoom(job->roomId(), JoinState::Join); }); return job; diff --git a/lib/connection.h b/lib/connection.h index cfad8774..b06fb143 100644 --- a/lib/connection.h +++ b/lib/connection.h @@ -461,7 +461,8 @@ namespace QMatrixClient CreateRoomJob* createDirectChat(const QString& userId, const QString& topic = {}, const QString& name = {}); - virtual JoinRoomJob* joinRoom(const QString& roomAlias); + virtual JoinRoomJob* joinRoom(const QString& roomAlias, + const QStringList& serverNames = {}); /** Sends /forget to the server and also deletes room locally. * This method is in Connection, not in Room, since it's a -- cgit v1.2.3