Harden UUID-handling code paths
This commit is contained in:

committed by
Scott Nonnenberg

parent
d3a27a6442
commit
bf04c9114e
@@ -17,12 +17,11 @@ function refreshOurProfile() {
|
||||
window.log.info('refreshOurProfile');
|
||||
const ourNumber = textsecure.storage.user.getNumber();
|
||||
const ourUuid = textsecure.storage.user.getUuid();
|
||||
const conversation = ConversationController.getOrCreate(
|
||||
// This is explicitly ourNumber first in order to avoid creating new
|
||||
// conversations when an old one exists
|
||||
ourNumber || ourUuid,
|
||||
'private'
|
||||
);
|
||||
const ourId = ConversationController.ensureContactIds({
|
||||
e164: ourNumber,
|
||||
uuid: ourUuid,
|
||||
});
|
||||
const conversation = ConversationController.get(ourId, 'private');
|
||||
conversation.updateUuid(ourUuid);
|
||||
conversation.updateE164(ourNumber);
|
||||
conversation.getProfiles();
|
||||
|
Reference in New Issue
Block a user