mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 16:49:40 +01:00
Improve IdentityDatabase e164 check.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user