diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index e181c5fa5..3618d72f3 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -25,6 +25,11 @@ #include "TargetConditionals.h" #endif +static NSString * const kStoryboardName = @"Storyboard"; +static NSString * const kInitialViewControllerIdentifier = @"UserInitialViewController"; +static NSString * const kURLSchemeSGNLKey = @"sgnl"; +static NSString * const kURLHostVerifyPrefix = @"verify"; + @interface AppDelegate () @property (nonatomic, retain) UIWindow *blankWindow; @@ -68,8 +73,8 @@ [DebugLogger.sharedInstance enableFileLogging]; } - UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:[NSBundle mainBundle]]; - UIViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"UserInitialViewController"]; + UIStoryboard *storyboard = [UIStoryboard storyboardWithName:kStoryboardName bundle:[NSBundle mainBundle]]; + UIViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:kInitialViewControllerIdentifier]; self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.rootViewController = viewController; @@ -122,8 +127,8 @@ } -(BOOL) application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation { - if ([url.scheme isEqualToString:@"sgnl"]) { - if ([url.host hasPrefix:@"verify"] && ![TSAccountManager isRegistered]) { + if ([url.scheme isEqualToString:kURLSchemeSGNLKey]) { + if ([url.host hasPrefix:kURLHostVerifyPrefix] && ![TSAccountManager isRegistered]) { id signupController = [Environment getCurrent].signUpFlowNavigationController; if ([signupController isKindOfClass:[UINavigationController class]]) { UINavigationController *navController = (UINavigationController*)signupController; diff --git a/Signal/src/view controllers/UITests/SignalsViewController.h b/Signal/src/view controllers/UITests/SignalsViewController.h index 3ad8bfe54..1f47219e9 100644 --- a/Signal/src/view controllers/UITests/SignalsViewController.h +++ b/Signal/src/view controllers/UITests/SignalsViewController.h @@ -24,7 +24,4 @@ @property (nonatomic, retain) CallState* latestCall; --(IBAction)selectedInbox:(id)sender; --(IBAction)selectedArchive:(id)sender; - @end diff --git a/Signal/src/view controllers/UITests/SignalsViewController.m b/Signal/src/view controllers/UITests/SignalsViewController.m index 908e38eab..5a2b1ce6f 100644 --- a/Signal/src/view controllers/UITests/SignalsViewController.m +++ b/Signal/src/view controllers/UITests/SignalsViewController.m @@ -108,15 +108,6 @@ static NSString* const kShowSignupFlowSegue = @"showSignupFlow"; [self updateInboxCountLabel]; } -- (void)viewDidAppear:(BOOL)animated{ - [super viewDidAppear:animated]; -} - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; -} - - -(void)tableViewSetUp { self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; @@ -215,8 +206,9 @@ static NSString* const kShowSignupFlowSegue = @"showSignupFlow"; NSIndexPath *indexPath = [self.tableView indexPathForCell:cell]; TSThread *thread = [self threadForIndexPath:indexPath]; + BOOL viewingThreadsIn = self.viewingThreadsIn; [self.editingDbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { - self.viewingThreadsIn == kInboxState ? [thread archiveThreadWithTransaction:transaction] : [thread unarchiveThreadWithTransaction:transaction]; + viewingThreadsIn == kInboxState ? [thread archiveThreadWithTransaction:transaction] : [thread unarchiveThreadWithTransaction:transaction]; }]; [self checkIfEmptyView];