Rename new contact thread view.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent 29848835f3
commit fd4f00fa4d

@ -54,7 +54,7 @@
34B3F87E1E8DF1700035BE1A /* InboxTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F84A1E8DF1700035BE1A /* InboxTableViewCell.m */; }; 34B3F87E1E8DF1700035BE1A /* InboxTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F84A1E8DF1700035BE1A /* InboxTableViewCell.m */; };
34B3F8801E8DF1700035BE1A /* InviteFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F84C1E8DF1700035BE1A /* InviteFlow.swift */; }; 34B3F8801E8DF1700035BE1A /* InviteFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F84C1E8DF1700035BE1A /* InviteFlow.swift */; };
34B3F8811E8DF1700035BE1A /* LockInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F84E1E8DF1700035BE1A /* LockInteractionController.m */; }; 34B3F8811E8DF1700035BE1A /* LockInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F84E1E8DF1700035BE1A /* LockInteractionController.m */; };
34B3F8821E8DF1700035BE1A /* MessageComposeTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8501E8DF1700035BE1A /* MessageComposeTableViewController.m */; }; 34B3F8821E8DF1700035BE1A /* NewContactThreadViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8501E8DF1700035BE1A /* NewContactThreadViewController.m */; };
34B3F8851E8DF1700035BE1A /* NewGroupViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8551E8DF1700035BE1A /* NewGroupViewController.m */; }; 34B3F8851E8DF1700035BE1A /* NewGroupViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8551E8DF1700035BE1A /* NewGroupViewController.m */; };
34B3F8861E8DF1700035BE1A /* NotificationSettingsOptionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8571E8DF1700035BE1A /* NotificationSettingsOptionsViewController.m */; }; 34B3F8861E8DF1700035BE1A /* NotificationSettingsOptionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8571E8DF1700035BE1A /* NotificationSettingsOptionsViewController.m */; };
34B3F8871E8DF1700035BE1A /* NotificationSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8591E8DF1700035BE1A /* NotificationSettingsViewController.m */; }; 34B3F8871E8DF1700035BE1A /* NotificationSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8591E8DF1700035BE1A /* NotificationSettingsViewController.m */; };
@ -481,8 +481,8 @@
34B3F84C1E8DF1700035BE1A /* InviteFlow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InviteFlow.swift; sourceTree = "<group>"; }; 34B3F84C1E8DF1700035BE1A /* InviteFlow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InviteFlow.swift; sourceTree = "<group>"; };
34B3F84D1E8DF1700035BE1A /* LockInteractionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LockInteractionController.h; sourceTree = "<group>"; }; 34B3F84D1E8DF1700035BE1A /* LockInteractionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LockInteractionController.h; sourceTree = "<group>"; };
34B3F84E1E8DF1700035BE1A /* LockInteractionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LockInteractionController.m; sourceTree = "<group>"; }; 34B3F84E1E8DF1700035BE1A /* LockInteractionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LockInteractionController.m; sourceTree = "<group>"; };
34B3F84F1E8DF1700035BE1A /* MessageComposeTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageComposeTableViewController.h; sourceTree = "<group>"; }; 34B3F84F1E8DF1700035BE1A /* NewContactThreadViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewContactThreadViewController.h; sourceTree = "<group>"; };
34B3F8501E8DF1700035BE1A /* MessageComposeTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MessageComposeTableViewController.m; sourceTree = "<group>"; }; 34B3F8501E8DF1700035BE1A /* NewContactThreadViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewContactThreadViewController.m; sourceTree = "<group>"; };
34B3F8541E8DF1700035BE1A /* NewGroupViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewGroupViewController.h; sourceTree = "<group>"; }; 34B3F8541E8DF1700035BE1A /* NewGroupViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewGroupViewController.h; sourceTree = "<group>"; };
34B3F8551E8DF1700035BE1A /* NewGroupViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewGroupViewController.m; sourceTree = "<group>"; }; 34B3F8551E8DF1700035BE1A /* NewGroupViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewGroupViewController.m; sourceTree = "<group>"; };
34B3F8561E8DF1700035BE1A /* NotificationSettingsOptionsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationSettingsOptionsViewController.h; sourceTree = "<group>"; }; 34B3F8561E8DF1700035BE1A /* NotificationSettingsOptionsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationSettingsOptionsViewController.h; sourceTree = "<group>"; };
@ -1027,8 +1027,8 @@
34B3F84C1E8DF1700035BE1A /* InviteFlow.swift */, 34B3F84C1E8DF1700035BE1A /* InviteFlow.swift */,
34B3F84D1E8DF1700035BE1A /* LockInteractionController.h */, 34B3F84D1E8DF1700035BE1A /* LockInteractionController.h */,
34B3F84E1E8DF1700035BE1A /* LockInteractionController.m */, 34B3F84E1E8DF1700035BE1A /* LockInteractionController.m */,
34B3F84F1E8DF1700035BE1A /* MessageComposeTableViewController.h */, 34B3F84F1E8DF1700035BE1A /* NewContactThreadViewController.h */,
34B3F8501E8DF1700035BE1A /* MessageComposeTableViewController.m */, 34B3F8501E8DF1700035BE1A /* NewContactThreadViewController.m */,
34B3F8541E8DF1700035BE1A /* NewGroupViewController.h */, 34B3F8541E8DF1700035BE1A /* NewGroupViewController.h */,
34B3F8551E8DF1700035BE1A /* NewGroupViewController.m */, 34B3F8551E8DF1700035BE1A /* NewGroupViewController.m */,
3471B1D81EB7C63600F6AEC8 /* NewNonContactConversationViewController.h */, 3471B1D81EB7C63600F6AEC8 /* NewNonContactConversationViewController.h */,
@ -2329,7 +2329,7 @@
34B3F8851E8DF1700035BE1A /* NewGroupViewController.m in Sources */, 34B3F8851E8DF1700035BE1A /* NewGroupViewController.m in Sources */,
B6C93C4E199567AD00EDF894 /* DebugLogger.m in Sources */, B6C93C4E199567AD00EDF894 /* DebugLogger.m in Sources */,
34D8C0271ED3673300188D7C /* DebugUIMessages.m in Sources */, 34D8C0271ED3673300188D7C /* DebugUIMessages.m in Sources */,
34B3F8821E8DF1700035BE1A /* MessageComposeTableViewController.m in Sources */, 34B3F8821E8DF1700035BE1A /* NewContactThreadViewController.m in Sources */,
3453D8EA1EC0D4ED003F9E6F /* OWSAlerts.swift in Sources */, 3453D8EA1EC0D4ED003F9E6F /* OWSAlerts.swift in Sources */,
45F659821E1BE77000444429 /* NonCallKitCallUIAdaptee.swift in Sources */, 45F659821E1BE77000444429 /* NonCallKitCallUIAdaptee.swift in Sources */,
45AE48511E0732D6004D96C2 /* TurnServerInfo.swift in Sources */, 45AE48511E0732D6004D96C2 /* TurnServerInfo.swift in Sources */,

@ -6,7 +6,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MessageComposeTableViewController : OWSViewController @interface NewContactThreadViewController : OWSViewController
@end @end

@ -2,7 +2,7 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// //
#import "MessageComposeTableViewController.h" #import "NewContactThreadViewController.h"
#import "ContactTableViewCell.h" #import "ContactTableViewCell.h"
#import "ContactsViewHelper.h" #import "ContactsViewHelper.h"
#import "Environment.h" #import "Environment.h"
@ -22,7 +22,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MessageComposeTableViewController () <UISearchBarDelegate, @interface NewContactThreadViewController () <UISearchBarDelegate,
ContactsViewHelperDelegate, ContactsViewHelperDelegate,
OWSTableViewControllerDelegate, OWSTableViewControllerDelegate,
NewNonContactConversationViewControllerDelegate, NewNonContactConversationViewControllerDelegate,
@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - #pragma mark -
@implementation MessageComposeTableViewController @implementation NewContactThreadViewController
- (void)loadView - (void)loadView
{ {
@ -211,7 +211,8 @@ NS_ASSUME_NONNULL_BEGIN
return view; return view;
} }
- (void)viewDidLoad { - (void)viewDidLoad
{
[super viewDidLoad]; [super viewDidLoad];
self.title = NSLocalizedString(@"MESSAGE_COMPOSEVIEW_TITLE", @""); self.title = NSLocalizedString(@"MESSAGE_COMPOSEVIEW_TITLE", @"");
@ -231,13 +232,15 @@ NS_ASSUME_NONNULL_BEGIN
[self showContactAppropriateViews]; [self showContactAppropriateViews];
} }
- (void)viewDidAppear:(BOOL)animated { - (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated]; [super viewDidAppear:animated];
[self showIOSUpgradeNagIfNecessary]; [self showIOSUpgradeNagIfNecessary];
} }
- (void)showIOSUpgradeNagIfNecessary { - (void)showIOSUpgradeNagIfNecessary
{
// Only show the nag to iOS 8 users. // Only show the nag to iOS 8 users.
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) { if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) {
return; return;
@ -253,13 +256,11 @@ NS_ASSUME_NONNULL_BEGIN
NSString *currentAppVersion = [AppVersion instance].currentAppVersion; NSString *currentAppVersion = [AppVersion instance].currentAppVersion;
OWSAssert(currentAppVersion.length > 0); OWSAssert(currentAppVersion.length > 0);
NSString *lastNagAppVersion = [Environment.preferences iOSUpgradeNagVersion]; NSString *lastNagAppVersion = [Environment.preferences iOSUpgradeNagVersion];
if (lastNagAppVersion && if (lastNagAppVersion && ![lastNagAppVersion isEqualToString:currentAppVersion]) {
![lastNagAppVersion isEqualToString:currentAppVersion]) {
[Environment.preferences setIOSUpgradeNagVersion:currentAppVersion]; [Environment.preferences setIOSUpgradeNagVersion:currentAppVersion];
[OWSAlerts showAlertWithTitle: [OWSAlerts showAlertWithTitle:NSLocalizedString(@"UPGRADE_IOS_ALERT_TITLE",
NSLocalizedString(@"UPGRADE_IOS_ALERT_TITLE",
@"Title for the alert indicating that user should upgrade iOS.") @"Title for the alert indicating that user should upgrade iOS.")
message:NSLocalizedString(@"UPGRADE_IOS_ALERT_MESSAGE", message:NSLocalizedString(@"UPGRADE_IOS_ALERT_MESSAGE",
@"Message for the alert indicating that user should upgrade iOS.")]; @"Message for the alert indicating that user should upgrade iOS.")];
@ -277,7 +278,7 @@ NS_ASSUME_NONNULL_BEGIN
return; return;
} }
__weak MessageComposeTableViewController *weakSelf = self; __weak NewContactThreadViewController *weakSelf = self;
ContactsViewHelper *helper = self.contactsViewHelper; ContactsViewHelper *helper = self.contactsViewHelper;
OWSTableSection *section = [OWSTableSection new]; OWSTableSection *section = [OWSTableSection new];
@ -461,8 +462,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)showContactAppropriateViews - (void)showContactAppropriateViews
{ {
if (self.contactsViewHelper.contactsManager.isSystemContactsAuthorized) { if (self.contactsViewHelper.contactsManager.isSystemContactsAuthorized) {
if (self.contactsViewHelper.hasUpdatedContactsAtLeastOnce if (self.contactsViewHelper.hasUpdatedContactsAtLeastOnce && self.contactsViewHelper.signalAccounts.count < 1
&& self.contactsViewHelper.signalAccounts.count < 1
&& ![[Environment preferences] hasDeclinedNoContactsView]) { && ![[Environment preferences] hasDeclinedNoContactsView]) {
self.isNoContactsModeActive = YES; self.isNoContactsModeActive = YES;
} else { } else {
@ -502,12 +502,12 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Send Invite By SMS #pragma mark - Send Invite By SMS
- (void)sendTextToPhoneNumber:(NSString *)phoneNumber { - (void)sendTextToPhoneNumber:(NSString *)phoneNumber
{
OWSAssert([phoneNumber length] > 0); OWSAssert([phoneNumber length] > 0);
NSString *confirmMessage = NSLocalizedString(@"SEND_SMS_CONFIRM_TITLE", @""); NSString *confirmMessage = NSLocalizedString(@"SEND_SMS_CONFIRM_TITLE", @"");
if ([phoneNumber length] > 0) { if ([phoneNumber length] > 0) {
confirmMessage = [[NSLocalizedString(@"SEND_SMS_INVITE_TITLE", @"") confirmMessage = [[NSLocalizedString(@"SEND_SMS_INVITE_TITLE", @"") stringByAppendingString:phoneNumber]
stringByAppendingString:phoneNumber]
stringByAppendingString:NSLocalizedString(@"QUESTIONMARK_PUNCTUATION", @"")]; stringByAppendingString:NSLocalizedString(@"QUESTIONMARK_PUNCTUATION", @"")];
} }
@ -543,10 +543,13 @@ NS_ASSUME_NONNULL_BEGIN
[alertController addAction:okAction]; [alertController addAction:okAction];
self.searchBar.text = @""; self.searchBar.text = @"";
//must dismiss search controller before presenting alert. // must dismiss search controller before presenting alert.
if ([self presentedViewController]) { if ([self presentedViewController]) {
[self dismissViewControllerAnimated:YES completion:^{ [self dismissViewControllerAnimated:YES
[self presentViewController:alertController animated:YES completion:[UIUtil modalCompletionBlock]]; completion:^{
[self presentViewController:alertController
animated:YES
completion:[UIUtil modalCompletionBlock]];
}]; }];
} else { } else {
[self presentViewController:alertController animated:YES completion:[UIUtil modalCompletionBlock]]; [self presentViewController:alertController animated:YES completion:[UIUtil modalCompletionBlock]];
@ -557,7 +560,8 @@ NS_ASSUME_NONNULL_BEGIN
// called on completion of message screen // called on completion of message screen
- (void)messageComposeViewController:(MFMessageComposeViewController *)controller - (void)messageComposeViewController:(MFMessageComposeViewController *)controller
didFinishWithResult:(MessageComposeResult)result { didFinishWithResult:(MessageComposeResult)result
{
switch (result) { switch (result) {
case MessageComposeResultCancelled: case MessageComposeResultCancelled:
break; break;
@ -576,8 +580,8 @@ NS_ASSUME_NONNULL_BEGIN
completion:^{ completion:^{
DDLogDebug(@"view controller dismissed"); DDLogDebug(@"view controller dismissed");
}]; }];
UIAlertView *successAlert = UIAlertView *successAlert = [[UIAlertView alloc]
[[UIAlertView alloc] initWithTitle:@"" initWithTitle:@""
message:NSLocalizedString(@"SEND_INVITE_SUCCESS", @"Alert body after invite succeeded") message:NSLocalizedString(@"SEND_INVITE_SUCCESS", @"Alert body after invite succeeded")
delegate:nil delegate:nil
cancelButtonTitle:NSLocalizedString(@"OK", @"") cancelButtonTitle:NSLocalizedString(@"OK", @"")
@ -760,7 +764,7 @@ NS_ASSUME_NONNULL_BEGIN
return; return;
} }
__weak MessageComposeTableViewController *weakSelf = self; __weak NewContactThreadViewController *weakSelf = self;
[[ContactsUpdater sharedUpdater] lookupIdentifiers:unknownPhoneNumbers [[ContactsUpdater sharedUpdater] lookupIdentifiers:unknownPhoneNumbers
success:^(NSArray<SignalRecipient *> *recipients) { success:^(NSArray<SignalRecipient *> *recipients) {
[weakSelf updateNonContactAccountSet:recipients]; [weakSelf updateNonContactAccountSet:recipients];

@ -6,9 +6,9 @@
#import "AppDelegate.h" #import "AppDelegate.h"
#import "AppSettingsViewController.h" #import "AppSettingsViewController.h"
#import "InboxTableViewCell.h" #import "InboxTableViewCell.h"
#import "MessageComposeTableViewController.h"
#import "MessagesViewController.h" #import "MessagesViewController.h"
#import "NSDate+millisecondTimeStamp.h" #import "NSDate+millisecondTimeStamp.h"
#import "NewContactThreadViewController.h"
#import "OWSContactsManager.h" #import "OWSContactsManager.h"
#import "OWSNavigationController.h" #import "OWSNavigationController.h"
#import "ProfileViewController.h" #import "ProfileViewController.h"
@ -344,7 +344,7 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
- (void)composeNew - (void)composeNew
{ {
MessageComposeTableViewController *viewController = [MessageComposeTableViewController new]; NewContactThreadViewController *viewController = [NewContactThreadViewController new];
[self.contactsManager requestSystemContactsOnceWithCompletion:^(NSError *_Nullable error) { [self.contactsManager requestSystemContactsOnceWithCompletion:^(NSError *_Nullable error) {
if (error) { if (error) {

Loading…
Cancel
Save