aboutsummaryrefslogtreecommitdiff
path: root/javascript/demo.html
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-07-08 11:16:00 +0100
committerMark Haines <mark.haines@matrix.org>2015-07-08 11:16:00 +0100
commit974e0984bd0d618093669780a75739d4b02fd3b2 (patch)
tree637841d1bb9cf3fc4e3f76af0253022afc29c4e6 /javascript/demo.html
parent3a382aec59937b086c37f039f1b011f253e80e97 (diff)
Update the javascript bindings and demo to match the format of the identity key JSON
Diffstat (limited to 'javascript/demo.html')
-rw-r--r--javascript/demo.html10
1 files changed, 8 insertions, 2 deletions
diff --git a/javascript/demo.html b/javascript/demo.html
index cace119..5a32e96 100644
--- a/javascript/demo.html
+++ b/javascript/demo.html
@@ -29,10 +29,16 @@ document.addEventListener("DOMContentLoaded", function (event) {
tasks.push(["alice", "Creating account", function() { alice.create() }]);
tasks.push(["bob", "Creating account", function() { bob.create() }]);
tasks.push(["alice", "Create outbound session", function() {
- var bobs_keys_1 = JSON.parse(bob.identity_keys())[0];
+ var bobs_id_keys = JSON.parse(bob.identity_keys("bob", "bob_device", 0, 0));
+ var bobs_curve25519_key;
+ for (key in bobs_id_keys.keys) {
+ if (key.startsWith("curve25519:")) {
+ bobs_curve25519_key = bobs_id_keys.keys[key];
+ }
+ }
var bobs_keys_2 = JSON.parse(bob.one_time_keys())[1];
a_session.create_outbound(
- alice, bobs_keys_1[1], bobs_keys_2[0], bobs_keys_2[1]
+ alice, bobs_curve25519_key, bobs_keys_2[0], bobs_keys_2[1]
);
}]);
tasks.push(["alice", "Encrypt first message", function() {