Pretty-print phone numbers.

This commit is contained in:
Greyson Parrelli
2020-11-04 15:49:56 -05:00
committed by Alan Evans
parent 3dc1614fbc
commit 9e5156ab73
6 changed files with 34 additions and 7 deletions

View File

@@ -13,6 +13,7 @@ import androidx.annotation.WorkerThread;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.database.DatabaseFactory;
import org.thoughtcrime.securesms.database.RecipientDatabase;
import org.thoughtcrime.securesms.phonenumbers.PhoneNumberFormatter;
import org.thoughtcrime.securesms.recipients.Recipient;
import org.thoughtcrime.securesms.util.Util;
import org.whispersystems.libsignal.util.Pair;
@@ -64,6 +65,10 @@ public class ContactRepository {
String phone = cursor.getString(cursor.getColumnIndexOrThrow(RecipientDatabase.PHONE));
String email = cursor.getString(cursor.getColumnIndexOrThrow(RecipientDatabase.EMAIL));
if (phone != null) {
phone = PhoneNumberFormatter.prettyPrint(phone);
}
return Util.getFirstNonEmpty(phone, email);
}));