1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-19 16:42:09 +03:00

Enable crypto if olm is present

This commit is contained in:
Mark Haines
2015-07-23 10:03:20 +01:00
parent 58e44a2fc3
commit ea1c315aa8
2 changed files with 6 additions and 3 deletions

View File

@@ -20,8 +20,11 @@ var utils = require("./utils");
var CRYPTO_ENABLED = false;
if (CRYPTO_ENABLED) {
try {
var Olm = require("olm");
CRYPTO_ENABLED = true;
} catch (e) {
// Olm not installed.
}
// TODO:
@@ -1799,7 +1802,7 @@ MatrixClient.prototype.startClient = function(historyLen) {
return;
}
if (this.sessionStore !== null) {
if (CRYPTO_ENABLED && this.sessionStore !== null) {
this.uploadKeys(5);
}