kopia lustrzana https://github.com/ryukoposting/Signal-Android
Improve IdentityDatabase e164 check.
rodzic
8c9eb880cf
commit
8e020c05f6
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue