aboutsummaryrefslogtreecommitdiff
path: root/lib/connection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/connection.cpp')
-rw-r--r--lib/connection.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 05dec7f9..e8c9a2dc 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -218,8 +218,9 @@ void Connection::doConnectToServer(const QString& user, const QString& password,
const QString& deviceId)
{
auto loginJob = callApi<LoginJob>(QStringLiteral("m.login.password"),
- user, /*medium*/ "", /*address*/ "", password, /*token*/ "",
- deviceId, initialDeviceName);
+ UserIdentifier { QStringLiteral("m.id.user"),
+ {{ QStringLiteral("user"), user }} },
+ password, /*token*/ "", deviceId, initialDeviceName);
connect(loginJob, &BaseJob::success, this,
[this, loginJob] {
d->connectWithToken(loginJob->userId(), loginJob->accessToken(),
@@ -506,19 +507,17 @@ DownloadFileJob* Connection::downloadFile(const QUrl& url,
CreateRoomJob* Connection::createRoom(RoomVisibility visibility,
const QString& alias, const QString& name, const QString& topic,
- const QStringList& invites, const QString& presetName,
- bool isDirect, bool guestsCanJoin,
+ QStringList invites, const QString& presetName, bool isDirect,
const QVector<CreateRoomJob::StateEvent>& initialState,
const QVector<CreateRoomJob::Invite3pid>& invite3pids,
const QJsonObject& creationContent)
{
- // FIXME: switch to using QStringList instead of const QStringList& in 0.4
- auto filteredInvites = invites;
- filteredInvites.removeOne(d->userId); // The creator is by definition in the room
+ invites.removeOne(d->userId); // The creator is by definition in the room
auto job = callApi<CreateRoomJob>(
- visibility == PublishRoom ? "public" : "private", alias, name,
- topic, filteredInvites, invite3pids, creationContent, initialState,
- presetName, isDirect, guestsCanJoin);
+ visibility == PublishRoom ? QStringLiteral("public")
+ : QStringLiteral("private"),
+ alias, name, topic, invites, invite3pids, QString(/*TODO: #233*/),
+ creationContent, initialState, presetName, isDirect);
connect(job, &BaseJob::success, this, [this,job] {
emit createdRoom(provideRoom(job->roomId(), JoinState::Join));
});