mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Rename new contact thread view.
// FREEBIE
This commit is contained in:
parent
29848835f3
commit
fd4f00fa4d
4 changed files with 48 additions and 44 deletions
|
@ -54,7 +54,7 @@
|
|||
34B3F87E1E8DF1700035BE1A /* InboxTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F84A1E8DF1700035BE1A /* InboxTableViewCell.m */; };
|
||||
34B3F8801E8DF1700035BE1A /* InviteFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F84C1E8DF1700035BE1A /* InviteFlow.swift */; };
|
||||
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 */; };
|
||||
34B3F8861E8DF1700035BE1A /* NotificationSettingsOptionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8571E8DF1700035BE1A /* NotificationSettingsOptionsViewController.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>"; };
|
||||
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>"; };
|
||||
34B3F84F1E8DF1700035BE1A /* MessageComposeTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageComposeTableViewController.h; sourceTree = "<group>"; };
|
||||
34B3F8501E8DF1700035BE1A /* MessageComposeTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MessageComposeTableViewController.m; sourceTree = "<group>"; };
|
||||
34B3F84F1E8DF1700035BE1A /* NewContactThreadViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewContactThreadViewController.h; 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>"; };
|
||||
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>"; };
|
||||
|
@ -1027,8 +1027,8 @@
|
|||
34B3F84C1E8DF1700035BE1A /* InviteFlow.swift */,
|
||||
34B3F84D1E8DF1700035BE1A /* LockInteractionController.h */,
|
||||
34B3F84E1E8DF1700035BE1A /* LockInteractionController.m */,
|
||||
34B3F84F1E8DF1700035BE1A /* MessageComposeTableViewController.h */,
|
||||
34B3F8501E8DF1700035BE1A /* MessageComposeTableViewController.m */,
|
||||
34B3F84F1E8DF1700035BE1A /* NewContactThreadViewController.h */,
|
||||
34B3F8501E8DF1700035BE1A /* NewContactThreadViewController.m */,
|
||||
34B3F8541E8DF1700035BE1A /* NewGroupViewController.h */,
|
||||
34B3F8551E8DF1700035BE1A /* NewGroupViewController.m */,
|
||||
3471B1D81EB7C63600F6AEC8 /* NewNonContactConversationViewController.h */,
|
||||
|
@ -2329,7 +2329,7 @@
|
|||
34B3F8851E8DF1700035BE1A /* NewGroupViewController.m in Sources */,
|
||||
B6C93C4E199567AD00EDF894 /* DebugLogger.m in Sources */,
|
||||
34D8C0271ED3673300188D7C /* DebugUIMessages.m in Sources */,
|
||||
34B3F8821E8DF1700035BE1A /* MessageComposeTableViewController.m in Sources */,
|
||||
34B3F8821E8DF1700035BE1A /* NewContactThreadViewController.m in Sources */,
|
||||
3453D8EA1EC0D4ED003F9E6F /* OWSAlerts.swift in Sources */,
|
||||
45F659821E1BE77000444429 /* NonCallKitCallUIAdaptee.swift in Sources */,
|
||||
45AE48511E0732D6004D96C2 /* TurnServerInfo.swift in Sources */,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MessageComposeTableViewController : OWSViewController
|
||||
@interface NewContactThreadViewController : OWSViewController
|
||||
|
||||
@end
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MessageComposeTableViewController.h"
|
||||
#import "NewContactThreadViewController.h"
|
||||
#import "ContactTableViewCell.h"
|
||||
#import "ContactsViewHelper.h"
|
||||
#import "Environment.h"
|
||||
|
@ -22,7 +22,7 @@
|
|||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MessageComposeTableViewController () <UISearchBarDelegate,
|
||||
@interface NewContactThreadViewController () <UISearchBarDelegate,
|
||||
ContactsViewHelperDelegate,
|
||||
OWSTableViewControllerDelegate,
|
||||
NewNonContactConversationViewControllerDelegate,
|
||||
|
@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
#pragma mark -
|
||||
|
||||
@implementation MessageComposeTableViewController
|
||||
@implementation NewContactThreadViewController
|
||||
|
||||
- (void)loadView
|
||||
{
|
||||
|
@ -211,7 +211,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
return view;
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
||||
self.title = NSLocalizedString(@"MESSAGE_COMPOSEVIEW_TITLE", @"");
|
||||
|
@ -231,13 +232,15 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
[self showContactAppropriateViews];
|
||||
}
|
||||
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
- (void)viewDidAppear:(BOOL)animated
|
||||
{
|
||||
[super viewDidAppear:animated];
|
||||
|
||||
|
||||
[self showIOSUpgradeNagIfNecessary];
|
||||
}
|
||||
|
||||
- (void)showIOSUpgradeNagIfNecessary {
|
||||
- (void)showIOSUpgradeNagIfNecessary
|
||||
{
|
||||
// Only show the nag to iOS 8 users.
|
||||
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) {
|
||||
return;
|
||||
|
@ -253,16 +256,14 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
NSString *currentAppVersion = [AppVersion instance].currentAppVersion;
|
||||
OWSAssert(currentAppVersion.length > 0);
|
||||
NSString *lastNagAppVersion = [Environment.preferences iOSUpgradeNagVersion];
|
||||
if (lastNagAppVersion &&
|
||||
![lastNagAppVersion isEqualToString:currentAppVersion]) {
|
||||
|
||||
if (lastNagAppVersion && ![lastNagAppVersion isEqualToString:currentAppVersion]) {
|
||||
|
||||
[Environment.preferences setIOSUpgradeNagVersion:currentAppVersion];
|
||||
|
||||
[OWSAlerts showAlertWithTitle:
|
||||
NSLocalizedString(@"UPGRADE_IOS_ALERT_TITLE",
|
||||
@"Title for the alert indicating that user should upgrade iOS.")
|
||||
|
||||
[OWSAlerts showAlertWithTitle:NSLocalizedString(@"UPGRADE_IOS_ALERT_TITLE",
|
||||
@"Title for the alert indicating that user should upgrade iOS.")
|
||||
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;
|
||||
}
|
||||
|
||||
__weak MessageComposeTableViewController *weakSelf = self;
|
||||
__weak NewContactThreadViewController *weakSelf = self;
|
||||
ContactsViewHelper *helper = self.contactsViewHelper;
|
||||
|
||||
OWSTableSection *section = [OWSTableSection new];
|
||||
|
@ -461,8 +462,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
- (void)showContactAppropriateViews
|
||||
{
|
||||
if (self.contactsViewHelper.contactsManager.isSystemContactsAuthorized) {
|
||||
if (self.contactsViewHelper.hasUpdatedContactsAtLeastOnce
|
||||
&& self.contactsViewHelper.signalAccounts.count < 1
|
||||
if (self.contactsViewHelper.hasUpdatedContactsAtLeastOnce && self.contactsViewHelper.signalAccounts.count < 1
|
||||
&& ![[Environment preferences] hasDeclinedNoContactsView]) {
|
||||
self.isNoContactsModeActive = YES;
|
||||
} else {
|
||||
|
@ -502,13 +502,13 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
#pragma mark - Send Invite By SMS
|
||||
|
||||
- (void)sendTextToPhoneNumber:(NSString *)phoneNumber {
|
||||
- (void)sendTextToPhoneNumber:(NSString *)phoneNumber
|
||||
{
|
||||
OWSAssert([phoneNumber length] > 0);
|
||||
NSString *confirmMessage = NSLocalizedString(@"SEND_SMS_CONFIRM_TITLE", @"");
|
||||
if ([phoneNumber length] > 0) {
|
||||
confirmMessage = [[NSLocalizedString(@"SEND_SMS_INVITE_TITLE", @"")
|
||||
stringByAppendingString:phoneNumber]
|
||||
stringByAppendingString:NSLocalizedString(@"QUESTIONMARK_PUNCTUATION", @"")];
|
||||
confirmMessage = [[NSLocalizedString(@"SEND_SMS_INVITE_TITLE", @"") stringByAppendingString:phoneNumber]
|
||||
stringByAppendingString:NSLocalizedString(@"QUESTIONMARK_PUNCTUATION", @"")];
|
||||
}
|
||||
|
||||
UIAlertController *alertController =
|
||||
|
@ -543,11 +543,14 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
[alertController addAction:okAction];
|
||||
self.searchBar.text = @"";
|
||||
|
||||
//must dismiss search controller before presenting alert.
|
||||
// must dismiss search controller before presenting alert.
|
||||
if ([self presentedViewController]) {
|
||||
[self dismissViewControllerAnimated:YES completion:^{
|
||||
[self presentViewController:alertController animated:YES completion:[UIUtil modalCompletionBlock]];
|
||||
}];
|
||||
[self dismissViewControllerAnimated:YES
|
||||
completion:^{
|
||||
[self presentViewController:alertController
|
||||
animated:YES
|
||||
completion:[UIUtil modalCompletionBlock]];
|
||||
}];
|
||||
} else {
|
||||
[self presentViewController:alertController animated:YES completion:[UIUtil modalCompletionBlock]];
|
||||
}
|
||||
|
@ -557,7 +560,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
// called on completion of message screen
|
||||
- (void)messageComposeViewController:(MFMessageComposeViewController *)controller
|
||||
didFinishWithResult:(MessageComposeResult)result {
|
||||
didFinishWithResult:(MessageComposeResult)result
|
||||
{
|
||||
switch (result) {
|
||||
case MessageComposeResultCancelled:
|
||||
break;
|
||||
|
@ -574,14 +578,14 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
case MessageComposeResultSent: {
|
||||
[self dismissViewControllerAnimated:NO
|
||||
completion:^{
|
||||
DDLogDebug(@"view controller dismissed");
|
||||
DDLogDebug(@"view controller dismissed");
|
||||
}];
|
||||
UIAlertView *successAlert =
|
||||
[[UIAlertView alloc] initWithTitle:@""
|
||||
message:NSLocalizedString(@"SEND_INVITE_SUCCESS", @"Alert body after invite succeeded")
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"OK", @"")
|
||||
otherButtonTitles:nil];
|
||||
UIAlertView *successAlert = [[UIAlertView alloc]
|
||||
initWithTitle:@""
|
||||
message:NSLocalizedString(@"SEND_INVITE_SUCCESS", @"Alert body after invite succeeded")
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"OK", @"")
|
||||
otherButtonTitles:nil];
|
||||
[successAlert show];
|
||||
break;
|
||||
}
|
||||
|
@ -760,7 +764,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
return;
|
||||
}
|
||||
|
||||
__weak MessageComposeTableViewController *weakSelf = self;
|
||||
__weak NewContactThreadViewController *weakSelf = self;
|
||||
[[ContactsUpdater sharedUpdater] lookupIdentifiers:unknownPhoneNumbers
|
||||
success:^(NSArray<SignalRecipient *> *recipients) {
|
||||
[weakSelf updateNonContactAccountSet:recipients];
|
|
@ -6,9 +6,9 @@
|
|||
#import "AppDelegate.h"
|
||||
#import "AppSettingsViewController.h"
|
||||
#import "InboxTableViewCell.h"
|
||||
#import "MessageComposeTableViewController.h"
|
||||
#import "MessagesViewController.h"
|
||||
#import "NSDate+millisecondTimeStamp.h"
|
||||
#import "NewContactThreadViewController.h"
|
||||
#import "OWSContactsManager.h"
|
||||
#import "OWSNavigationController.h"
|
||||
#import "ProfileViewController.h"
|
||||
|
@ -344,7 +344,7 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
|
|||
|
||||
- (void)composeNew
|
||||
{
|
||||
MessageComposeTableViewController *viewController = [MessageComposeTableViewController new];
|
||||
NewContactThreadViewController *viewController = [NewContactThreadViewController new];
|
||||
|
||||
[self.contactsManager requestSystemContactsOnceWithCompletion:^(NSError *_Nullable error) {
|
||||
if (error) {
|
||||
|
|
Loading…
Reference in a new issue