aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-09-12 04:38:23 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-09-12 04:38:23 +0200
commit06a4fbb5c0ad0fadba1e5924f73d067850a78312 (patch)
tree8ce50e3969befa8529b1fe6039f41d42764d2f2d
parent77b69eb370e1cdbc33e44121f4f8483e19cad7d8 (diff)
downloadlibquotient-06a4fbb5c0ad0fadba1e5924f73d067850a78312.tar.gz
libquotient-06a4fbb5c0ad0fadba1e5924f73d067850a78312.zip
Connection: update AccountRegistry
Clients don't need to do it themselves.
-rw-r--r--lib/connection.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 51946b2f..4abf5097 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -13,6 +13,7 @@
#include "room.h"
#include "settings.h"
#include "user.h"
+#include "accountregistry.h"
// NB: since Qt 6, moc_connection.cpp needs Room and User fully defined
#include "moc_connection.cpp"
@@ -258,6 +259,7 @@ Connection::~Connection()
{
qCDebug(MAIN) << "deconstructing connection object for" << userId();
stopSync();
+ AccountRegistry::instance().drop(this);
}
void Connection::resolveServer(const QString& mxid)
@@ -441,6 +443,7 @@ void Connection::Private::completeSetup(const QString& mxId)
qCDebug(MAIN) << "Using server" << data->baseUrl().toDisplayString()
<< "by user" << data->userId()
<< "from device" << data->deviceId();
+ AccountRegistry::instance().add(q);
#ifndef Quotient_E2EE_ENABLED
qCWarning(E2EE) << "End-to-end encryption (E2EE) support is turned off.";
#else // Quotient_E2EE_ENABLED