aboutsummaryrefslogtreecommitdiff
path: root/javascript
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2016-09-14 11:10:05 +0100
committerMark Haines <mjark@negativecurvature.net>2016-09-14 11:10:05 +0100
commit6dfa64342ac01b66f1e84bf4ffafd0a12d3c1b6d (patch)
tree966e6238e3796b416dc2788292aff97d789ad345 /javascript
parentf274adfe245397a58a167a2ffc266a880d9a8d89 (diff)
Fix the group javascript demo
Diffstat (limited to 'javascript')
-rw-r--r--javascript/demo/group_demo.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/javascript/demo/group_demo.js b/javascript/demo/group_demo.js
index 35b22a3..1b8f7ab 100644
--- a/javascript/demo/group_demo.js
+++ b/javascript/demo/group_demo.js
@@ -261,7 +261,7 @@ DemoUser.prototype.receiveOneToOne = function(jsonpacket) {
if (!self.peerGroupSessions[sender] ||
!self.peerGroupSessions[sender][body.session_id]) {
self.createInboundSession(
- sender, body.session_id, body.message_index, body.session_key
+ sender, body.session_id, body.session_key
);
}
});
@@ -337,15 +337,18 @@ DemoUser.prototype.getGroupSession = function() {
* add a task to create an inbound group session
*/
DemoUser.prototype.createInboundSession = function(
- peer_id, session_id, message_index, session_key, callback
+ peer_id, session_id, session_key, callback
) {
var self = this;
this.addTask("init inbound session", function(done) {
session = new Olm.InboundGroupSession();
- session.create(message_index, session_key);
+ session.create(session_key);
if (!self.peerGroupSessions[peer_id]) {
self.peerGroupSessions[peer_id] = {};
}
+ if (session_id != session.session_id()) {
+ throw new Error("Mismatched session_ids");
+ }
self.peerGroupSessions[peer_id][session_id] = session;
done(session);
}, callback);