Fix dropping the first websocket message

This commit is contained in:
lilia 2015-08-31 12:18:01 -07:00
parent 3fcd980c23
commit 9de23a967b
2 changed files with 10 additions and 8 deletions

View file

@ -39147,15 +39147,16 @@ var TextSecureServer = (function() {
}.bind(this));
},
registerSecondDevice: function(setProvisioningUrl, confirmNumber, progressCallback) {
var socket = this.server.getProvisioningSocket();
socket.onclose = function(e) {
console.log('websocket closed', e.code);
};
var createAccount = this.createAccount.bind(this);
var generateKeys = this.generateKeys.bind(this, 100, progressCallback);
var registerKeys = this.server.registerKeys.bind(this.server);
var getSocket = this.server.getProvisioningSocket.bind(this.server);
return textsecure.protocol_wrapper.createIdentityKeyRecvSocket().then(function(cryptoInfo) {
return new Promise(function(resolve) {
var socket = getSocket();
socket.onclose = function(e) {
console.log('websocket closed', e.code);
};
var wsr = new WebSocketResource(socket, {
keepalive: { path: '/v1/keepalive/provisioning' },
handleRequest: function(request) {

View file

@ -31,15 +31,16 @@
}.bind(this));
},
registerSecondDevice: function(setProvisioningUrl, confirmNumber, progressCallback) {
var socket = this.server.getProvisioningSocket();
socket.onclose = function(e) {
console.log('websocket closed', e.code);
};
var createAccount = this.createAccount.bind(this);
var generateKeys = this.generateKeys.bind(this, 100, progressCallback);
var registerKeys = this.server.registerKeys.bind(this.server);
var getSocket = this.server.getProvisioningSocket.bind(this.server);
return textsecure.protocol_wrapper.createIdentityKeyRecvSocket().then(function(cryptoInfo) {
return new Promise(function(resolve) {
var socket = getSocket();
socket.onclose = function(e) {
console.log('websocket closed', e.code);
};
var wsr = new WebSocketResource(socket, {
keepalive: { path: '/v1/keepalive/provisioning' },
handleRequest: function(request) {