1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2026-01-03 23:22:30 +03:00

Bump to Olm 2.0

... since the code requires it. Also update the tests.
This commit is contained in:
Richard van der Hoff
2016-12-14 14:15:31 +00:00
parent 223bd459f6
commit b11bff5a5b
3 changed files with 14 additions and 8 deletions

View File

@@ -56,6 +56,6 @@
"watchify": "^3.2.1"
},
"optionalDependencies": {
"olm": "https://matrix.org/packages/npm/olm/olm-1.3.0.tgz"
"olm": "https://matrix.org/packages/npm/olm/olm-2.0.0.tgz"
}
}

View File

@@ -548,9 +548,11 @@ describe("megolm", function() {
'PUT', '/send/'
).respond(200, function(path, content) {
var ct = content.ciphertext;
var decrypted = JSON.parse(inboundGroupSession.decrypt(ct));
var r = inboundGroupSession.decrypt(ct);
console.log('Decrypted received megolm message', r);
console.log('Decrypted received megolm message', decrypted);
expect(r.message_index).toEqual(0);
var decrypted = JSON.parse(r.plaintext);
expect(decrypted.type).toEqual('m.room.message');
expect(decrypted.content.body).toEqual('test');
@@ -795,8 +797,10 @@ describe("megolm", function() {
'PUT', '/send/'
).respond(200, function(path, content) {
var ct = content.ciphertext;
decrypted = JSON.parse(inboundGroupSession.decrypt(ct));
console.log('Decrypted received megolm message', decrypted);
var r = inboundGroupSession.decrypt(ct);
console.log('Decrypted received megolm message', r);
decrypted = JSON.parse(r.plaintext);
return {
event_id: '$event_id',
};
@@ -838,9 +842,11 @@ describe("megolm", function() {
'PUT', '/send/'
).respond(200, function(path, content) {
var ct = content.ciphertext;
var decrypted = JSON.parse(inboundGroupSession.decrypt(ct));
var r = inboundGroupSession.decrypt(ct);
console.log('Decrypted received megolm message', r);
console.log('Decrypted received megolm message', decrypted);
expect(r.message_index).toEqual(0);
var decrypted = JSON.parse(r.plaintext);
expect(decrypted.type).toEqual('m.room.message');
expect(decrypted.content.body).toEqual('test');

View File

@@ -9,6 +9,6 @@ describe("Crypto", function() {
}
it("Crypto exposes the correct olm library version", function() {
expect(Crypto.getOlmVersion()).toEqual([1, 3, 0]);
expect(Crypto.getOlmVersion()).toEqual([2, 0, 0]);
});
});