1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

experimental support for warning users when unknown devices show up in a room.

hopefully a step towards fixing https://github.com/vector-im/riot-web/issues/2143
This commit is contained in:
Matthew Hodgson
2017-01-21 05:10:51 +00:00
parent 49e6fd3c60
commit fb820fa9a7
4 changed files with 90 additions and 3 deletions

View File

@@ -157,6 +157,21 @@ module.exports.DecryptionError = function(msg) {
};
utils.inherits(module.exports.DecryptionError, Error);
/**
* Exception thrown specifically when we want to warn the user to consider
* the security of their conversation before continuing
*
* @constructor
* @param {string} msg message describing the problem
* @extends Error
*/
module.exports.UnknownDeviceError = function(msg, devices) {
this.name = "UnknownDeviceError";
this.message = msg;
this.devices = devices;
};
utils.inherits(module.exports.UnknownDeviceError, Error);
/**
* Registers an encryption/decryption class for a particular algorithm
*