Improve IdentityDatabase e164 check.
This commit is contained in:
parent
8c9eb880cf
commit
8e020c05f6
1 changed files with 5 additions and 1 deletions
|
@ -108,7 +108,7 @@ public class IdentityDatabase extends Database {
|
|||
firstUse,
|
||||
timestamp,
|
||||
nonblockingApproval);
|
||||
} else if (addressName.charAt(0) != '+') {
|
||||
} else if (!fastIsE164(addressName)) {
|
||||
if (DatabaseFactory.getRecipientDatabase(context).containsPhoneOrUuid(addressName)) {
|
||||
Recipient recipient = Recipient.external(context, addressName);
|
||||
|
||||
|
@ -269,4 +269,8 @@ public class IdentityDatabase extends Database {
|
|||
|
||||
EventBus.getDefault().post(new IdentityRecord(recipientId, identityKey, verifiedStatus, firstUse, timestamp, nonBlockingApproval));
|
||||
}
|
||||
|
||||
private boolean fastIsE164(@NonNull String value) {
|
||||
return value.charAt(0) == '+' || value.length() <= 15;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue