Add missing `await` for `ConversationController.getOrCreateAndWait`

Tested this by setting `if` condition to `true` and confirming it works.
It turns rotating a profile key is more involved and might require registering a
new account according to Matthew.
This commit is contained in:
Daniel Gasienica 2018-02-14 11:01:30 -05:00
parent c08058ee4b
commit 462defbe55
1 changed files with 2 additions and 2 deletions

View File

@ -503,9 +503,9 @@
// eslint-disable-next-line no-bitwise
if (data.message.flags & textsecure.protobuf.DataMessage.Flags.PROFILE_KEY_UPDATE) {
const profileKey = data.message.profileKey.toArrayBuffer();
const sender = ConversationController.getOrCreateAndWait(data.source, 'private');
const sender =
await ConversationController.getOrCreateAndWait(data.source, 'private');
await sender.setProfileKey(profileKey);
// TODO: Is `ev.confirm` a `Promise`? Original code returned it:
return ev.confirm();
}