diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2020-04-15 09:27:41 +0200 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2020-04-15 12:53:26 +0200 |
commit | 7ecc82079f85a7fa29f122fd2fd78401af0ee799 (patch) | |
tree | 832c53e90476d0de0ac661c1014d0df39e7a4954 | |
parent | 4088ab4572c5b7cde603aeb1a89bc4515833beaf (diff) | |
download | libquotient-7ecc82079f85a7fa29f122fd2fd78401af0ee799.tar.gz libquotient-7ecc82079f85a7fa29f122fd2fd78401af0ee799.zip |
Connection: connectToServer -> loginWithPassword
connectToServer() is left for compatibility but deprecated.
-rw-r--r-- | lib/connection.cpp | 7 | ||||
-rw-r--r-- | lib/connection.h | 15 | ||||
-rw-r--r-- | tests/quotest.cpp | 2 |
3 files changed, 16 insertions, 8 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp index 41ecee67..229a6564 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -312,9 +312,10 @@ inline UserIdentifier make3rdPartyIdentifier(const QString& medium, { QStringLiteral("address"), address } } }; } -void Connection::connectToServer(const QString& userId, const QString& password, - const QString& initialDeviceName, - const QString& deviceId) +void Connection::loginWithPassword(const QString& userId, + const QString& password, + const QString& initialDeviceName, + const QString& deviceId) { checkAndConnect(userId, [=] { d->loginToServer(LoginFlows::Password.type, makeUserIdentifier(userId), diff --git a/lib/connection.h b/lib/connection.h index b0263732..32d6df79 100644 --- a/lib/connection.h +++ b/lib/connection.h @@ -509,15 +509,22 @@ public slots: /** Determine and set the homeserver from MXID */ void resolveServer(const QString& mxid); - void connectToServer(const QString& userId, const QString& password, - const QString& initialDeviceName, - const QString& deviceId = {}); + void loginWithPassword(const QString& userId, const QString& password, + const QString& initialDeviceName, + const QString& deviceId = {}); void loginWithToken(const QByteArray& loginToken, const QString& initialDeviceName, const QString& deviceId = {}); void assumeIdentity(const QString& userId, const QString& accessToken, const QString& deviceId); - /*! @deprecated + /*! \deprecated Use loginWithPassword instead */ + void connectToServer(const QString& userId, const QString& password, + const QString& initialDeviceName, + const QString& deviceId = {}) + { + loginWithPassword(userId, password, initialDeviceName, deviceId); + } + /*! \deprecated * Use assumeIdentity() if you have an access token or * loginWithToken() if you have a login token. */ diff --git a/tests/quotest.cpp b/tests/quotest.cpp index 4f7c4026..ae5ece30 100644 --- a/tests/quotest.cpp +++ b/tests/quotest.cpp @@ -169,7 +169,7 @@ TestManager::TestManager(int& argc, char** argv) { Q_ASSERT(argc >= 5); clog << "Connecting to Matrix as " << argv[1] << endl; - c->connectToServer(argv[1], argv[2], argv[3]); + c->loginWithPassword(argv[1], argv[2], argv[3]); targetRoomName = argv[4]; clog << "Test room name: " << argv[4] << endl; if (argc > 5) { |