remove stale comment and simplify conversation creation

pull/381/head
sachaaaaa 6 years ago
parent 88c1454c18
commit bf8bb23683

@ -77,7 +77,6 @@
pairingAuthorisation, pairingAuthorisation,
}); });
const options = {}; const options = {};
// Send a empty message with information about how to contact us directly
const outgoingMessage = new textsecure.OutgoingMessage( const outgoingMessage = new textsecure.OutgoingMessage(
null, // server null, // server
Date.now(), // timestamp, Date.now(), // timestamp,

@ -563,23 +563,15 @@
} }
// Validate pubKey // Validate pubKey
const c = new Whisper.Conversation({ const c = await ConversationController.getOrCreateAndWait(
id: secondaryDevicePubKey, secondaryDevicePubKey,
type: 'private', 'private'
}); );
const validationError = c.validateNumber(); const validationError = c.validateNumber();
if (validationError) { if (validationError) {
throw new Error('Invalid secondary device pubkey provided'); throw new Error('Invalid secondary device pubkey provided');
} }
// Ensure there is a conversation existing // Ensure there is a conversation existing
try {
await ConversationController.getOrCreateAndWait(
secondaryDevicePubKey,
'private'
);
} catch (e) {
window.log.error(e);
}
const signature = await libloki.crypto.generateSignatureForPairing( const signature = await libloki.crypto.generateSignatureForPairing(
secondaryDevicePubKey, secondaryDevicePubKey,
textsecure.protobuf.PairingAuthorisationMessage.Type.PAIRING_REQUEST textsecure.protobuf.PairingAuthorisationMessage.Type.PAIRING_REQUEST

Loading…
Cancel
Save