mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-25 12:17:22 +00:00
Filter out invalid phone numbers from system contacts.
Some phones are putting UUIDs in phone number fields. Who knows why. Fixes #12191
This commit is contained in:
committed by
Cody Henthorne
parent
2a086ad574
commit
b8c42fa57e
@@ -33,6 +33,7 @@ import org.thoughtcrime.securesms.util.Stopwatch
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences
|
||||
import org.thoughtcrime.securesms.util.Util
|
||||
import org.whispersystems.signalservice.api.push.SignalServiceAddress
|
||||
import org.whispersystems.signalservice.api.util.UuidUtil
|
||||
import java.io.IOException
|
||||
import java.util.Calendar
|
||||
|
||||
@@ -299,7 +300,9 @@ object ContactDiscovery {
|
||||
contactsProvider().use { iterator ->
|
||||
while (iterator.hasNext()) {
|
||||
val details = iterator.next()
|
||||
val phoneDetailsWithoutSelf: List<ContactPhoneDetails> = details.numbers.filter { it.number != localNumber }
|
||||
val phoneDetailsWithoutSelf: List<ContactPhoneDetails> = details.numbers
|
||||
.filter { it.number != localNumber }
|
||||
.filterNot { UuidUtil.isUuid(it.number) }
|
||||
|
||||
for (phoneDetails in phoneDetailsWithoutSelf) {
|
||||
val realNumber: String = Util.getFirstNonEmpty(rewrites[phoneDetails.number], phoneDetails.number)
|
||||
|
||||
Reference in New Issue
Block a user