diff --git a/Signal/src/ViewControllers/Registration/RegistrationViewController.m b/Signal/src/ViewControllers/Registration/RegistrationViewController.m index 6bde5e7e5..0aae5902d 100644 --- a/Signal/src/ViewControllers/Registration/RegistrationViewController.m +++ b/Signal/src/ViewControllers/Registration/RegistrationViewController.m @@ -253,7 +253,7 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi self.phoneNumberTextField.text = [self lastRegisteredPhoneNumber]; #endif - NSNumber *callingCode = [[PhoneNumberUtil sharedUtil].nbPhoneNumberUtil getCountryCodeForRegion:countryCode]; + NSNumber *callingCode = [[PhoneNumberUtil sharedThreadLocal].nbPhoneNumberUtil getCountryCodeForRegion:countryCode]; NSString *countryName = [PhoneNumberUtil countryNameFromCountryCode:countryCode]; [self updateCountryWithName:countryName callingCode:[NSString stringWithFormat:@"%@%@", COUNTRY_CODE_PREFIX, callingCode] diff --git a/SignalMessaging/contacts/SelectRecipientViewController.m b/SignalMessaging/contacts/SelectRecipientViewController.m index 5a4627bbe..1a681849c 100644 --- a/SignalMessaging/contacts/SelectRecipientViewController.m +++ b/SignalMessaging/contacts/SelectRecipientViewController.m @@ -218,13 +218,13 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien OWSAssert(callingCode); if (callingCode) { NSString *prefix = [NSString stringWithFormat:@"+%d", callingCode.intValue]; - countryCode = [[PhoneNumberUtil sharedUtil] probableCountryCodeForCallingCode:prefix]; + countryCode = [[PhoneNumberUtil sharedThreadLocal] probableCountryCodeForCallingCode:prefix]; } } if (!countryCode || !callingCode) { countryCode = [PhoneNumber defaultCountryCode]; - callingCode = [[PhoneNumberUtil sharedUtil].nbPhoneNumberUtil getCountryCodeForRegion:countryCode]; + callingCode = [[PhoneNumberUtil sharedThreadLocal].nbPhoneNumberUtil getCountryCodeForRegion:countryCode]; } NSString *countryName = [PhoneNumberUtil countryNameFromCountryCode:countryCode]; diff --git a/SignalServiceKit/src/Contacts/PhoneNumber.m b/SignalServiceKit/src/Contacts/PhoneNumber.m index a22b84595..9af598d86 100644 --- a/SignalServiceKit/src/Contacts/PhoneNumber.m +++ b/SignalServiceKit/src/Contacts/PhoneNumber.m @@ -217,7 +217,7 @@ static NSString *const RPDefaultsKeyPhoneNumberCanonical = @"RPDefaultsKeyPhoneN if (localCallingCode != nil) { NSString *localCallingCodePrefix = [NSString stringWithFormat:@"+%@", localCallingCode]; NSString *localCountryCode = - [PhoneNumberUtil.sharedUtil probableCountryCodeForCallingCode:localCallingCodePrefix]; + [PhoneNumberUtil.sharedThreadLocal probableCountryCodeForCallingCode:localCallingCodePrefix]; if (localCountryCode && ![localCountryCode isEqualToString:[self defaultCountryCode]]) { NBMetadataHelper *helper = [[NBMetadataHelper alloc] init]; NBPhoneMetaData *localNumberRegionMetadata = [helper getMetadataForRegion:localCountryCode]; @@ -332,7 +332,7 @@ static NSString *const RPDefaultsKeyPhoneNumberCanonical = @"RPDefaultsKeyPhoneN // Italian phone number but use French region/language for their // phone. They're likely to have both Italian and French contacts. NSString *localCountryCode = - [PhoneNumberUtil.sharedUtil probableCountryCodeForCallingCode:callingCodePrefix]; + [PhoneNumberUtil.sharedThreadLocal probableCountryCodeForCallingCode:callingCodePrefix]; if (localCountryCode && ![localCountryCode isEqualToString:[self defaultCountryCode]]) { tryParsingWithCountryCode( [callingCodePrefix stringByAppendingString:sanitizedString], localCountryCode);