Fix pkb not being saved on the first cipher message.

pull/52/head
Mikunj 7 years ago
parent 0404f42738
commit 149da3374a

@ -725,19 +725,10 @@ MessageReceiver.prototype.extend({
// We don't automatically save on a friend request because // We don't automatically save on a friend request because
// we only want to save the preKeys when we click the accept button. // we only want to save the preKeys when we click the accept button.
if (envelope.type !== textsecure.protobuf.Envelope.Type.FRIEND_REQUEST) { if (envelope.type !== textsecure.protobuf.Envelope.Type.FRIEND_REQUEST) {
try { await this.handlePreKeyBundleMessage(
const conversation = window.ConversationController.get(envelope.source); envelope.source,
envelope.preKeyBundleMessage
// Make sure we only save the preKeys if we're friends );
if (conversation.isFriend()) {
await this.handlePreKeyBundleMessage(
envelope.source,
envelope.preKeyBundleMessage
);
}
} catch (e) {
window.log.info('Error saving preKeyBundleMessage from: ', envelope.source);
}
} }
} }

Loading…
Cancel
Save