diff --git a/javascript/demo/group_demo.js b/javascript/demo/group_demo.js index c8939d3..bd54ea0 100644 --- a/javascript/demo/group_demo.js +++ b/javascript/demo/group_demo.js @@ -24,8 +24,9 @@ function DemoUser(name) { this.olmAccount = new Olm.Account(); this.olmAccount.create(); - /* a list of the people in our chat */ - this.peers = []; + /* the people in our chat, indexed by their Curve25519 identity key. + */ + this.peers = {}; /* for each peer, a one-to-one session - indexed by id key and created on * demand */ @@ -41,6 +42,18 @@ function DemoUser(name) { /* a list of pending tasks */ this.tasks = []; this.taskWorker = undefined; + + /* the operations our peers are allowed to do on us */ + var publicOps = [ + "getIdKey", "getOneTimeKey", + "receiveOneToOne", "receiveGroup", + ]; + + this.remoteOps = {}; + for (var i=0; i