You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-05 17:02:07 +03:00
Check for the correct capability when refreshing
This commit is contained in:
@@ -277,11 +277,11 @@ Room.prototype.getRecommendedVersion = async function() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const caps = await this._client.getCapabilities(true);
|
const caps = await this._client.getCapabilities(true);
|
||||||
if (!caps) {
|
versionCap = caps["m.room_versions"];
|
||||||
logger.warn("No server capabilities - assuming upgrade needed");
|
if (!versionCap) {
|
||||||
|
logger.warn("No room version capability - assuming upgrade required.");
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
versionCap = caps["m.room_versions"];
|
|
||||||
result = this._checkVersionAgainstCapability(versionCap);
|
result = this._checkVersionAgainstCapability(versionCap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -301,7 +301,7 @@ Room.prototype._checkVersionAgainstCapability = function(versionCap) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// If the room is on the default version then nothing needs to change
|
// If the room is on the default version then nothing needs to change
|
||||||
if (currentVersion === versionCap.default) return Promise.resolve(result);
|
if (currentVersion === versionCap.default) return result;
|
||||||
|
|
||||||
const stableVersions = Object.keys(versionCap.available)
|
const stableVersions = Object.keys(versionCap.available)
|
||||||
.filter((v) => versionCap.available[v] === 'stable');
|
.filter((v) => versionCap.available[v] === 'stable');
|
||||||
|
|||||||
Reference in New Issue
Block a user