Add more safeguards to isTrustedIdentity
This commit is contained in:
parent
896dfcb43f
commit
1b5c36a9a8
2 changed files with 6 additions and 4 deletions
|
@ -501,9 +501,11 @@
|
|||
throw new Error('Tried to get identity key for undefined/null key');
|
||||
}
|
||||
const identifier = textsecure.utils.unencodeNumber(encodedAddress)[0];
|
||||
const ourNumber = textsecure.storage.user.getNumber();
|
||||
const ourUuid = textsecure.storage.user.getUuid();
|
||||
const isOurIdentifier =
|
||||
identifier === textsecure.storage.user.getNumber() ||
|
||||
identifier === textsecure.storage.user.getUuid();
|
||||
(ourNumber && identifier === ourNumber) ||
|
||||
(ourUuid && identifier === ourUuid);
|
||||
|
||||
const identityRecord = this.getIdentityRecord(identifier);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue