Wait for prekeys to be processed before sending a message on session reset.

Remove old code.
pull/843/head
Mikunj 5 years ago
parent 942c76ce6b
commit 6620092959

@ -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();

@ -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(

Loading…
Cancel
Save