You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Use stable API prefix for 3PID APIs when supported
If the server advertises spec version r0.6.0, it must have the 3PID APIs available under the stable API prefix. Fixes https://github.com/vector-im/riot-web/issues/11246
This commit is contained in:
@@ -4210,6 +4210,16 @@ MatrixClient.prototype.getVersions = async function() {
|
||||
return this._serverVersionsCache;
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if a particular spec version is supported by the server.
|
||||
* @param {string} version The spec version (such as "r0.5.0") to check for.
|
||||
* @return {Promise<bool>} Whether it is supported
|
||||
*/
|
||||
MatrixClient.prototype.isVersionSupported = async function(version) {
|
||||
const { versions } = await this.getVersions();
|
||||
return versions && versions.includes(version);
|
||||
};
|
||||
|
||||
/**
|
||||
* Query the server to see if it support members lazy loading
|
||||
* @return {Promise<boolean>} true if server supports lazy loading
|
||||
|
||||
Reference in New Issue
Block a user