Fix assumption about unstable feature reporting

The key can be in the unstable features list, but it can be false. This
stops some features showing up and hitting API that isn't actually
implemented.
This commit is contained in:
Joshua Goins
2025-12-20 17:26:24 -05:00
parent c572480d10
commit 6fcb1cc1e3

View File

@@ -136,9 +136,9 @@ void NeoChatConnection::connectSignals()
this,
[this] {
callApi<GetVersionsJob>(BackgroundRequest).onResult([this](const auto &job) {
m_canCheckMutualRooms = job->unstableFeatures().contains("uk.half-shot.msc2666.query_mutual_rooms"_L1);
m_canCheckMutualRooms = job->unstableFeatures().value("uk.half-shot.msc2666.query_mutual_rooms"_L1, false);
Q_EMIT canCheckMutualRoomsChanged();
m_canEraseData = job->unstableFeatures().contains("org.matrix.msc4025"_L1) || job->versions().count("v1.10"_L1);
m_canEraseData = job->unstableFeatures().value("org.matrix.msc4025"_L1, false) || job->versions().count("v1.10"_L1);
Q_EMIT canEraseDataChanged();
});
},