Skip to content

Commit

Permalink
???
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasFella committed Dec 14, 2024
1 parent 781924e commit d3814ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Quotient/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ void Connection::Private::completeSetup(const QString& mxId, bool newLogin,
const std::optional<QString>& deviceId,
const std::optional<QString>& accessToken)
{
qWarning() << "completeSetup";
q->setObjectName(data->userId() % u'/' % data->deviceId());
data->setIdentity(mxId, deviceId.value_or(u""_s), accessToken.value_or(u""_s).toLatin1());
qCDebug(MAIN) << "Using server" << data->baseUrl().toDisplayString()
Expand All @@ -423,19 +424,24 @@ void Connection::Private::completeSetup(const QString& mxId, bool newLogin,
q->loadCapabilities();
q->user()->load(); // Load the local user's profile
}
qWarning() << "completeSetup 2";
auto doCompleteSetup = [this, mxId, deviceId, accessToken](){
setupPicklingKey();
qWarning() << "completeSetup 3";

emit q->stateChanged();

qWarning() << useEncryption;
if (useEncryption) {
emit q->encryptionChanged(useEncryption);
emit q->stateChanged();
emit q->ready();
qWarning() << "compelteSetup 4";
emit q->connected();
} else {
qCInfo(E2EE) << "End-to-end encryption (E2EE) support is off for" << q->objectName();
emit q->ready();
qWarning() << "completeSetup 5";
emit q->connected();
}
};
Expand Down
7 changes: 6 additions & 1 deletion quotest/quotest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ TestManager::TestManager(int& argc, char** argv)
clog.flush();
// NOLINTEND(cppcoreguidelines-pro-bounds-pointer-arithmetic)

qWarning() << "Connecting to connected";
connect(c, &Connection::connected, this, [this] {
qWarning() << "Connected";
if (QUO_ALARM(c->homeserver().isEmpty() || !c->homeserver().isValid())
|| QUO_ALARM(c->domain() != c->userId().section(u':', 1))) {
clog << "Connection information doesn't look right, "
Expand Down Expand Up @@ -252,17 +254,21 @@ TestManager::TestManager(int& argc, char** argv)

void TestManager::setupAndRun()
{
qWarning() << 1;
Q_ASSERT(!c->homeserver().isEmpty() && c->homeserver().isValid());
Q_ASSERT(c->domain() == c->userId().section(u':', 1));
clog << "Connected, server: " << c->homeserver().toDisplayString().toStdString() << '\n'
<< "Access token: " << c->accessToken().toStdString() << endl;

qWarning() << 2;
connect(c, &Connection::loadedRoomState, this, &TestManager::onNewRoom);

c->setLazyLoading(true);

qWarning() << 3;
clog << "Joining " << targetRoomName.toStdString() << endl;
c->joinAndGetRoom(targetRoomName).then(this, [this](Room* room) {
qWarning() << 4;
if (!room) {
clog << "Failed to join the test room" << endl;
finalize();
Expand Down Expand Up @@ -965,7 +971,6 @@ void TestManager::finalize(const QString& lastWords)
clog << "Logging out" << endl;
c->logout().then(
this, [this, lastWords] {
//clog << lastWords.toStdString() << endl;
QCoreApplication::exit(!testSuite ? -3
: succeeded.empty() && failed.empty()
&& running.empty()
Expand Down

0 comments on commit d3814ed

Please sign in to comment.