Fix compilation with e2ee disabled

This commit is contained in:
Carl Schwan
2023-07-28 13:01:54 +02:00
parent c22c74f735
commit 7c1b43bcad
2 changed files with 8 additions and 0 deletions

View File

@@ -185,8 +185,10 @@ int main(int argc, char *argv[])
initLogging();
#if Quotient_VERSION_MINOR == 8
#ifdef Quotient_E2EE_ENABLED
Connection::setEncryptionDefault(true);
#endif
#endif
#ifdef NEOCHAT_FLATPAK
// Copy over the included FontConfig configuration to the

View File

@@ -56,6 +56,7 @@ QVariant DevicesModel::data(const QModelIndex &index, int role) const
if (device.deviceId == m_connection->deviceId()) {
return This;
}
#ifdef Quotient_E2EE_ENABLED
if (!m_connection->isKnownE2eeCapableDevice(m_connection->userId(), device.deviceId)) {
return Unencrypted;
}
@@ -64,6 +65,9 @@ QVariant DevicesModel::data(const QModelIndex &index, int role) const
} else {
return Unverified;
}
#else
return Unverified;
#endif
}
return {};
}
@@ -147,6 +151,7 @@ void DevicesModel::setConnection(Connection *connection)
Q_EMIT connectionChanged();
fetchDevices();
#ifdef Quotient_E2EE_ENABLED
connect(m_connection, &Connection::sessionVerified, this, [this](const QString &userId, const QString &deviceId) {
Q_UNUSED(deviceId);
if (userId == Controller::instance().activeConnection()->userId()) {
@@ -156,6 +161,7 @@ void DevicesModel::setConnection(Connection *connection)
connect(m_connection, &Connection::finishedQueryingKeys, this, [this]() {
fetchDevices();
});
#endif
}
#include "moc_devicesmodel.cpp"