diff --git a/libtextsecure/message_receiver.js b/libtextsecure/message_receiver.js index c3aec94d0..757cfbcfa 100644 --- a/libtextsecure/message_receiver.js +++ b/libtextsecure/message_receiver.js @@ -1361,6 +1361,7 @@ MessageReceiver.prototype.extend({ content.preKeyBundleMessage ); } + if (content.lokiAddressMessage) { return this.handleLokiAddressMessage( envelope, @@ -1724,7 +1725,7 @@ MessageReceiver.prototype.extend({ textsecure.storage.protocol, address ); - builder.processPreKey(device); + await builder.processPreKey(device); }) ); await conversation.onSessionResetReceived(); diff --git a/libtextsecure/sendmessage.js b/libtextsecure/sendmessage.js index 2f0dbc001..191379418 100644 --- a/libtextsecure/sendmessage.js +++ b/libtextsecure/sendmessage.js @@ -1041,64 +1041,6 @@ MessageSender.prototype = { silent, options ).catch(logError('resetSession/sendToContact error:')); - /* - const deleteAllSessions = targetNumber => - textsecure.storage.protocol.getDeviceIds(targetNumber).then(deviceIds => - Promise.all( - deviceIds.map(deviceId => { - const address = new libsignal.SignalProtocolAddress( - targetNumber, - deviceId - ); - window.log.info('deleting sessions for', address.toString()); - const sessionCipher = new libsignal.SessionCipher( - textsecure.storage.protocol, - address - ); - return sessionCipher.deleteAllSessionsForDevice(); - }) - ) - ); - - const sendToContactPromise = deleteAllSessions(number) - .catch(logError('resetSession/deleteAllSessions1 error:')) - .then(() => { - window.log.info( - 'finished closing local sessions, now sending to contact' - ); - return this.sendIndividualProto( - number, - proto, - timestamp, - silent, - options - ).catch(logError('resetSession/sendToContact error:')); - }) - .then(() => - deleteAllSessions(number).catch( - logError('resetSession/deleteAllSessions2 error:') - ) - ); - - const myNumber = textsecure.storage.user.getNumber(); - // We already sent the reset session to our other devices in the code above! - if (number === myNumber) { - return sendToContactPromise; - } - - const buffer = proto.toArrayBuffer(); - const sendSyncPromise = this.sendSyncMessage( - buffer, - timestamp, - number, - null, - [], - [], - options - ).catch(logError('resetSession/sendSync error:')); - - return Promise.all([sendToContact, sendSyncPromise]); - */ }, async sendMessageToGroup(