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
Check the right Synapse endpoint for determining admin capabilities
This commit is contained in:
@@ -4021,9 +4021,13 @@ MatrixClient.prototype.isFallbackICEServerAllowed = function() {
|
|||||||
* @return {boolean} true if the user appears to be a Synapse administrator.
|
* @return {boolean} true if the user appears to be a Synapse administrator.
|
||||||
*/
|
*/
|
||||||
MatrixClient.prototype.isSynapseAdministrator = function() {
|
MatrixClient.prototype.isSynapseAdministrator = function() {
|
||||||
return this.whoisSynapseUser(this.getUserId())
|
const path = utils.encodeUri(
|
||||||
.then(() => true)
|
"/_synapse/admin/v1/users/$userId/admin",
|
||||||
.catch(() => false);
|
{ $userId: userId },
|
||||||
|
);
|
||||||
|
return this._http.authedRequest(
|
||||||
|
undefined, 'GET', path, undefined, undefined, {prefix: ''},
|
||||||
|
).then(r => r['admin']); // pull out the specific boolean we want
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user