You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-25 05:23:13 +03:00
Add 3PID unbind API
This commit is contained in:
@@ -1406,6 +1406,26 @@ MatrixBaseApis.prototype.bindThreePid = function(data) {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unbind a 3PID for discovery on an identity server via the homeserver. The
|
||||||
|
* homeserver removes its record of the binding to keep an updated record of
|
||||||
|
* where all 3PIDs for the account are bound.
|
||||||
|
*
|
||||||
|
* @param {Object} data A object with 3PID validation data from having called
|
||||||
|
* `validate/<medium>/requestToken` on the identity server. It should also
|
||||||
|
* contain `id_server` and `id_access_token` fields as well.
|
||||||
|
* @return {module:client.Promise} Resolves: on success
|
||||||
|
* @return {module:http-api.MatrixError} Rejects: with an error response.
|
||||||
|
*/
|
||||||
|
MatrixBaseApis.prototype.unbindThreePid = function(data) {
|
||||||
|
const path = "/account/3pid/unbind";
|
||||||
|
return this._http.authedRequest(
|
||||||
|
undefined, "POST", path, null, data, {
|
||||||
|
prefix: httpApi.PREFIX_UNSTABLE,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} medium The threepid medium (eg. 'email')
|
* @param {string} medium The threepid medium (eg. 'email')
|
||||||
* @param {string} address The threepid address (eg. 'bob@example.com')
|
* @param {string} address The threepid address (eg. 'bob@example.com')
|
||||||
|
|||||||
Reference in New Issue
Block a user