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
Merge pull request #1071 from matrix-org/travis/new-deactivate
Check the right Synapse endpoint for determining admin capabilities
This commit is contained in:
@@ -4278,9 +4278,13 @@ MatrixClient.prototype.isFallbackICEServerAllowed = function() {
|
||||
* @return {boolean} true if the user appears to be a Synapse administrator.
|
||||
*/
|
||||
MatrixClient.prototype.isSynapseAdministrator = function() {
|
||||
return this.whoisSynapseUser(this.getUserId())
|
||||
.then(() => true)
|
||||
.catch(() => false);
|
||||
const path = utils.encodeUri(
|
||||
"/_synapse/admin/v1/users/$userId/admin",
|
||||
{ $userId: this.getUserId() },
|
||||
);
|
||||
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