This repository has been archived on 2022-08-19. You can view files and clone it, but cannot push or open issues or pull requests.
hydrogen-web/src/matrix/ServerFeatures.js

20 lines
462 B
JavaScript
Raw Normal View History

2020-06-27 02:56:24 +05:30
const R0_5_0 = "r0.5.0";
export class ServerFeatures {
constructor(versionResponse) {
this._versionResponse = versionResponse;
}
_supportsVersion(version) {
if (!this._versionResponse) {
return false;
}
const {versions} = this._versionResponse;
return Array.isArray(versions) && versions.includes(version);
}
get lazyLoadMembers() {
return this._supportsVersion(R0_5_0);
}
}