mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-26 03:40:56 +01:00
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user