1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

track whether we blacklist unverified devices per-room & globally

This commit is contained in:
Matthew Hodgson
2017-01-21 17:38:35 +00:00
parent e79926db6c
commit 512d5882c9
5 changed files with 63 additions and 2 deletions

View File

@@ -403,6 +403,21 @@ function _setDeviceVerification(client, userId, deviceId, verified, blocked) {
client.emit("deviceVerificationChanged", userId, deviceId);
}
/**
* Set the global override for whether the client should ever send encrypted
* messages to unverified devices. If false, it can still be overridden
* per-room. If true, it overrides the per-room settings.
*
* @param {boolean} value whether to unilaterally blacklist all
* unverified devices
*/
MatrixClient.prototype.setGlobalBlacklistUnverifiedDevices = function(value) {
if (this._crypto === null) {
throw new Error("End-to-end encryption disabled");
}
this._crypto.setGlobalBlacklistUnverifiedDevices(value);
};
/**
* Get e2e information on the device that sent an event
*