Fix issues with Mexican phone number formatting.

Fixes #9317
This commit is contained in:
Greyson Parrelli
2020-01-17 18:32:26 -05:00
parent e37c4b1f87
commit b8602ee004
6 changed files with 435 additions and 98 deletions

View File

@@ -214,11 +214,18 @@ public class Recipient {
*/
@WorkerThread
public static @NonNull Recipient externalContact(@NonNull Context context, @NonNull String identifier) {
RecipientDatabase db = DatabaseFactory.getRecipientDatabase(context);
RecipientId id = null;
if (UuidUtil.isUuid(identifier)) {
throw new UuidRecipientError();
} else if (NumberUtil.isValidEmail(identifier)) {
id = db.getOrInsertFromEmail(identifier);
} else {
return external(context, identifier);
id = db.getOrInsertFromE164(identifier);
}
return Recipient.resolved(id);
}
/**