From da7dd1b128d56edbe5eb341cb7b2191c0f4daccd Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 28 Apr 2017 14:25:53 -0400 Subject: [PATCH] Clean up debug scaffolding. // FREEBIE --- .../AddToBlockListViewController.m | 5 ++++ .../ViewControllers/BlockListViewController.m | 5 ---- .../MessageComposeTableViewController.m | 7 ------ .../ViewControllers/MessagesViewController.m | 13 ----------- .../ViewControllers/NewGroupViewController.m | 15 ++---------- ...SConversationSettingsTableViewController.m | 23 ------------------- .../PrivacySettingsTableViewController.m | 5 ---- .../SettingsTableViewController.m | 5 ---- .../ViewControllers/SignalsViewController.m | 15 ------------ .../UpdateGroupViewController.m | 14 ++--------- 10 files changed, 9 insertions(+), 98 deletions(-) diff --git a/Signal/src/ViewControllers/AddToBlockListViewController.m b/Signal/src/ViewControllers/AddToBlockListViewController.m index abed047bb..16b1f10e4 100644 --- a/Signal/src/ViewControllers/AddToBlockListViewController.m +++ b/Signal/src/ViewControllers/AddToBlockListViewController.m @@ -105,6 +105,11 @@ NS_ASSUME_NONNULL_BEGIN return YES; } +- (BOOL)shouldHideContacts +{ + return NO; +} + - (BOOL)shouldValidatePhoneNumbers { return NO; diff --git a/Signal/src/ViewControllers/BlockListViewController.m b/Signal/src/ViewControllers/BlockListViewController.m index 0f3d72d1c..996306d6c 100644 --- a/Signal/src/ViewControllers/BlockListViewController.m +++ b/Signal/src/ViewControllers/BlockListViewController.m @@ -74,11 +74,6 @@ typedef NS_ENUM(NSInteger, BlockListViewControllerSection) { { [super viewDidLoad]; [self.navigationController.navigationBar setTranslucent:NO]; - - dispatch_async(dispatch_get_main_queue(), ^{ - AddToBlockListViewController *vc = [[AddToBlockListViewController alloc] init]; - [self.navigationController pushViewController:vc animated:YES]; - }); } #pragma mark - Table view data source diff --git a/Signal/src/ViewControllers/MessageComposeTableViewController.m b/Signal/src/ViewControllers/MessageComposeTableViewController.m index 316a09d49..b02541ed1 100644 --- a/Signal/src/ViewControllers/MessageComposeTableViewController.m +++ b/Signal/src/ViewControllers/MessageComposeTableViewController.m @@ -157,13 +157,6 @@ NSString *const MessageComposeTableViewControllerCellContact = @"ContactTableVie self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; [self createLoadingAndBackgroundViews]; self.title = NSLocalizedString(@"MESSAGE_COMPOSEVIEW_TITLE", @""); - - dispatch_async(dispatch_get_main_queue(), ^{ - NewGroupViewController *newGroupViewController = [NewGroupViewController new]; - // [[UIStoryboard main] instantiateViewControllerWithIdentifier:@"NewGroupViewController"]; - // [newGroupViewController configWithThread:(TSGroupThread *)self.thread]; - [self.navigationController pushViewController:newGroupViewController animated:YES]; - }); } - (void)viewWillAppear:(BOOL)animated diff --git a/Signal/src/ViewControllers/MessagesViewController.m b/Signal/src/ViewControllers/MessagesViewController.m index 9267a4d79..32acd161a 100644 --- a/Signal/src/ViewControllers/MessagesViewController.m +++ b/Signal/src/ViewControllers/MessagesViewController.m @@ -409,12 +409,6 @@ typedef enum : NSUInteger { contactsManager:self.contactsManager blockingManager:self.blockingManager]; } - dispatch_async(dispatch_get_main_queue(), ^{ - // [self performSegueWithIdentifier:@"composeNew" sender:self]; - // TSThread *thread = [self threadForIndexPath:[NSIndexPath indexPathForItem:0 inSection:0]]; - // [self presentThread:thread keyboardOnViewAppearing:NO callOnViewAppearing:NO]; - [self showConversationSettings]; - }); } - (void)viewDidLayoutSubviews @@ -737,13 +731,6 @@ typedef enum : NSUInteger { _callOnOpen = NO; } [self updateNavigationBarSubtitleLabel]; - - // dispatch_async(dispatch_get_main_queue(), ^{ - // // [self performSegueWithIdentifier:@"composeNew" sender:self]; - // // TSThread *thread = [self threadForIndexPath:[NSIndexPath indexPathForItem:0 inSection:0]]; - // // [self presentThread:thread keyboardOnViewAppearing:NO callOnViewAppearing:NO]; - // [self showConversationSettings]; - // }); } - (void)viewWillDisappear:(BOOL)animated { diff --git a/Signal/src/ViewControllers/NewGroupViewController.m b/Signal/src/ViewControllers/NewGroupViewController.m index 9e2b6d415..4052b8666 100644 --- a/Signal/src/ViewControllers/NewGroupViewController.m +++ b/Signal/src/ViewControllers/NewGroupViewController.m @@ -499,9 +499,8 @@ NS_ASSUME_NONNULL_BEGIN OWSAssert(image); self.avatarView.image = image; - // TODO. - // self.groupImageButton.imageView.layer.borderColor = [[UIColor lightGrayColor] CGColor]; - // self.groupImageButton.imageView.layer.borderWidth = 0.5f; + self.avatarView.layer.borderColor = [[UIColor lightGrayColor] CGColor]; + self.avatarView.layer.borderWidth = 0.5f; self.avatarView.contentMode = UIViewContentModeScaleAspectFill; } @@ -525,16 +524,6 @@ NS_ASSUME_NONNULL_BEGIN NSLocalizedString(@"NEW_GROUP_VIEW_UNSAVED_CHANGES_MESSAGE", @"The alert message if user tries to exit the new group view without saving changes.") preferredStyle:UIAlertControllerStyleAlert]; - [controller addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"ALERT_SAVE", - @"The label for the 'save' button in action sheets.") - style:UIAlertActionStyleDefault - handler:^(UIAlertAction *action) { - OWSAssert(self.delegate); - - [self createGroup]; - - [self.delegate popAllConversationSettingsViews]; - }]]; [controller addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"ALERT_DISCARD_BUTTON", @"The label for the 'discard' button in alerts and action sheets.") diff --git a/Signal/src/ViewControllers/OWSConversationSettingsTableViewController.m b/Signal/src/ViewControllers/OWSConversationSettingsTableViewController.m index 238004aa8..a3ad5b485 100644 --- a/Signal/src/ViewControllers/OWSConversationSettingsTableViewController.m +++ b/Signal/src/ViewControllers/OWSConversationSettingsTableViewController.m @@ -140,29 +140,6 @@ NS_ASSUME_NONNULL_BEGIN } [self updateTableContents]; - - if ([self.thread isKindOfClass:[TSGroupThread class]]) { - dispatch_async(dispatch_get_main_queue(), ^{ - OWSAssert(self.delegate); - UpdateGroupViewController *updateGroupViewController = [UpdateGroupViewController new]; - updateGroupViewController.delegate = self.delegate; - updateGroupViewController.thread = (TSGroupThread *)self.thread; - [self.navigationController pushViewController:updateGroupViewController animated:YES]; - }); - } -} - -- (void)viewDidAppear:(BOOL)animated -{ - [super viewDidAppear:animated]; - - // dispatch_async(dispatch_get_main_queue(), ^{ - // OWSAssert(self.delegate); - // UpdateGroupViewController *updateGroupViewController = [UpdateGroupViewController new]; - // updateGroupViewController.delegate = self.delegate; - // [updateGroupViewController configWithThread:(TSGroupThread *)self.thread]; - // [self.navigationController pushViewController:updateGroupViewController animated:YES]; - // }); } - (void)updateTableContents diff --git a/Signal/src/ViewControllers/PrivacySettingsTableViewController.m b/Signal/src/ViewControllers/PrivacySettingsTableViewController.m index d1dc20387..525659bd0 100644 --- a/Signal/src/ViewControllers/PrivacySettingsTableViewController.m +++ b/Signal/src/ViewControllers/PrivacySettingsTableViewController.m @@ -52,11 +52,6 @@ typedef NS_ENUM(NSInteger, PrivacySettingsTableViewControllerSectionIndex) { [self.navigationController.navigationBar setTranslucent:NO]; self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; - - dispatch_async(dispatch_get_main_queue(), ^{ - BlockListViewController *vc = [[BlockListViewController alloc] init]; - [self.navigationController pushViewController:vc animated:YES]; - }); } - (instancetype)init { diff --git a/Signal/src/ViewControllers/SettingsTableViewController.m b/Signal/src/ViewControllers/SettingsTableViewController.m index a08def5d8..00917baae 100644 --- a/Signal/src/ViewControllers/SettingsTableViewController.m +++ b/Signal/src/ViewControllers/SettingsTableViewController.m @@ -105,11 +105,6 @@ typedef enum { [self.destroyAccountButton setTitle:NSLocalizedString(@"SETTINGS_DELETE_ACCOUNT_BUTTON", @"") forState:UIControlStateNormal]; - - dispatch_async(dispatch_get_main_queue(), ^{ - PrivacySettingsTableViewController *vc = [[PrivacySettingsTableViewController alloc] init]; - [self.navigationController pushViewController:vc animated:YES]; - }); } - (void)viewWillAppear:(BOOL)animated diff --git a/Signal/src/ViewControllers/SignalsViewController.m b/Signal/src/ViewControllers/SignalsViewController.m index 9565fdea3..6b07a2539 100644 --- a/Signal/src/ViewControllers/SignalsViewController.m +++ b/Signal/src/ViewControllers/SignalsViewController.m @@ -163,15 +163,6 @@ NSString *const SignalsViewControllerSegueShowIncomingCall = @"ShowIncomingCallS object:nil]; [self updateBarButtonItems]; - - dispatch_async(dispatch_get_main_queue(), ^{ - // [self settingsButtonPressed:nil]; - - [self performSegueWithIdentifier:@"composeNew" sender:self]; - - // TSThread *thread = [self threadForIndexPath:[NSIndexPath indexPathForItem:0 inSection:0]]; - // [self presentThread:thread keyboardOnViewAppearing:NO callOnViewAppearing:NO]; - }); } - (void)updateBarButtonItems { @@ -297,12 +288,6 @@ NSString *const SignalsViewControllerSegueShowIncomingCall = @"ShowIncomingCallS } else { [self displayAnyUnseenUpgradeExperience]; } - - // dispatch_async(dispatch_get_main_queue(), ^{ - // // [self performSegueWithIdentifier:@"composeNew" sender:self]; - // TSThread *thread = [self threadForIndexPath:[NSIndexPath indexPathForItem:0 inSection:0]]; - // [self presentThread:thread keyboardOnViewAppearing:NO callOnViewAppearing:NO]; - // }); } #pragma mark - startup diff --git a/Signal/src/ViewControllers/UpdateGroupViewController.m b/Signal/src/ViewControllers/UpdateGroupViewController.m index 173cad020..d9b11b2d7 100644 --- a/Signal/src/ViewControllers/UpdateGroupViewController.m +++ b/Signal/src/ViewControllers/UpdateGroupViewController.m @@ -121,12 +121,6 @@ NS_ASSUME_NONNULL_BEGIN [_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:firstSection]; [_tableViewController.view autoPinEdgeToSuperviewEdge:ALEdgeBottom]; - dispatch_async(dispatch_get_main_queue(), ^{ - AddToGroupViewController *viewController = [AddToGroupViewController new]; - viewController.addToGroupDelegate = self; - [self.navigationController pushViewController:viewController animated:YES]; - }); - [self updateTableContents]; } @@ -407,12 +401,8 @@ NS_ASSUME_NONNULL_BEGIN OWSAssert(image); self.avatarView.image = image; - // [self.avatarView setImage:image forState:UIControlStateNormal]; - // self.groupImageButton.imageView.layer.cornerRadius = CGRectGetWidth([self.groupImageButton.imageView frame]) - // / 2.0f; self.groupImageButton.imageView.layer.masksToBounds = YES; - // TODO. - // self.groupImageButton.imageView.layer.borderColor = [[UIColor lightGrayColor] CGColor]; - // self.groupImageButton.imageView.layer.borderWidth = 0.5f; + self.avatarView.layer.borderColor = [[UIColor lightGrayColor] CGColor]; + self.avatarView.layer.borderWidth = 0.5f; self.avatarView.contentMode = UIViewContentModeScaleAspectFill; }