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.

(cherry picked from commit 6fcb1cc1e3)
This commit is contained in:
Joshua Goins
2025-12-20 17:26:24 -05:00
parent bae20aaf84
commit bceeef14de

View File

@@ -135,9 +135,9 @@ void NeoChatConnection::connectSignals()
[this] {
auto job = callApi<GetVersionsJob>(BackgroundRequest);
connect(job, &GetVersionsJob::success, this, [this, 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();
});
},