diff --git a/Signal/src/ViewControllers/NewContactThreadViewController.m b/Signal/src/ViewControllers/NewContactThreadViewController.m index e1421e0d4..9ed219369 100644 --- a/Signal/src/ViewControllers/NewContactThreadViewController.m +++ b/Signal/src/ViewControllers/NewContactThreadViewController.m @@ -459,7 +459,10 @@ NS_ASSUME_NONNULL_BEGIN // No Contacts OWSTableSection *contactsSection = [OWSTableSection new]; - if (self.contactsManager.isSystemContactsAuthorized) { + // Loki: Original code + // ======== +// if (self.contactsManager.isSystemContactsAuthorized) { + // ======== if (self.contactsViewHelper.hasUpdatedContactsAtLeastOnce) { [contactsSection @@ -490,7 +493,10 @@ NS_ASSUME_NONNULL_BEGIN [OWSTableItem itemWithCustomCell:loadingCell customRowHeight:40 actionBlock:nil]; [contactsSection addItem:loadingItem]; } - } + // Loki: Original code + // ======== +// } + // ======== return @[ contactsSection ]; } @@ -759,7 +765,10 @@ NS_ASSUME_NONNULL_BEGIN - (void)showContactAppropriateViews { - if (self.contactsManager.isSystemContactsAuthorized) { + // Loki: Original code + // ======== +// if (self.contactsManager.isSystemContactsAuthorized) { + // ======== if (self.contactsViewHelper.hasUpdatedContactsAtLeastOnce && self.contactsViewHelper.signalAccounts.count < 1 && ![Environment.shared.preferences hasDeclinedNoContactsView]) { self.isNoContactsModeActive = YES; @@ -768,11 +777,14 @@ NS_ASSUME_NONNULL_BEGIN } [self showSearchBar:YES]; - } else { - // don't show "no signal contacts", show "no contact access" - self.isNoContactsModeActive = NO; - [self showSearchBar:NO]; - } + // Loki: Original code + // ======== +// } else { +// // don't show "no signal contacts", show "no contact access" +// self.isNoContactsModeActive = NO; +// [self showSearchBar:NO]; +// } + // ======== } - (void)setIsNoContactsModeActive:(BOOL)isNoContactsModeActive diff --git a/SignalMessaging/contacts/SystemContactsFetcher.swift b/SignalMessaging/contacts/SystemContactsFetcher.swift index 82433ab4d..32a6bbb4c 100644 --- a/SignalMessaging/contacts/SystemContactsFetcher.swift +++ b/SignalMessaging/contacts/SystemContactsFetcher.swift @@ -231,29 +231,34 @@ public class SystemContactsFetcher: NSObject { switch authorizationStatus { case .notDetermined: - if CurrentAppContext().isInBackground() { - Logger.error("do not request contacts permission when app is in background") - completion(nil) - return - } - self.contactStoreAdapter.requestAccess { (granted, error) in - if let error = error { - Logger.error("error fetching contacts: \(error)") - completion(error) - return - } - - guard granted else { - // This case should have been caught by the error guard a few lines up. - owsFailDebug("declined contact access.") - completion(nil) - return - } - - DispatchQueue.main.async { - self.updateContacts(completion: completion) - } - } + return completion(nil) + + // Loki: Original code + // ======== +// if CurrentAppContext().isInBackground() { +// Logger.error("do not request contacts permission when app is in background") +// completion(nil) +// return +// } +// self.contactStoreAdapter.requestAccess { (granted, error) in +// if let error = error { +// Logger.error("error fetching contacts: \(error)") +// completion(error) +// return +// } +// +// guard granted else { +// // This case should have been caught by the error guard a few lines up. +// owsFailDebug("declined contact access.") +// completion(nil) +// return +// } +// +// DispatchQueue.main.async { +// self.updateContacts(completion: completion) +// } +// } + // ======== case .authorized: self.updateContacts(completion: completion) case .denied, .restricted: