mirror of https://github.com/oxen-io/session-ios
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			102 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			Matlab
		
	
		
		
			
		
	
	
			102 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			Matlab
		
	
| 
											9 years ago
										 | // | ||
| 
											8 years ago
										 | //  Copyright (c) 2018 Open Whisper Systems. All rights reserved. | ||
| 
											9 years ago
										 | // | ||
|  | 
 | ||
|  | #import "NewNonContactConversationViewController.h" | ||
|  | #import "BlockListUIUtils.h" | ||
|  | #import "ContactsViewHelper.h" | ||
| 
											8 years ago
										 | #import <SignalMessaging/OWSContactsManager.h> | ||
| 
											9 years ago
										 | #import <SignalServiceKit/SignalAccount.h> | ||
| 
											9 years ago
										 | 
 | ||
|  | NS_ASSUME_NONNULL_BEGIN | ||
|  | 
 | ||
|  | @interface NewNonContactConversationViewController () <SelectRecipientViewControllerDelegate> | ||
|  | 
 | ||
|  | @end | ||
|  | 
 | ||
|  | #pragma mark - | ||
|  | 
 | ||
|  | @implementation NewNonContactConversationViewController | ||
|  | 
 | ||
|  | - (void)loadView | ||
|  | { | ||
|  |     self.delegate = self; | ||
|  | 
 | ||
|  |     [super loadView]; | ||
|  | 
 | ||
|  |     self.title = NSLocalizedString( | ||
|  |         @"NEW_NONCONTACT_CONVERSATION_VIEW_TITLE", @"Title for the 'new non-contact conversation' view."); | ||
|  | } | ||
|  | 
 | ||
|  | - (NSString *)phoneNumberSectionTitle | ||
|  | { | ||
|  |     return nil; | ||
|  | } | ||
|  | 
 | ||
|  | - (NSString *)phoneNumberButtonText | ||
|  | { | ||
|  |     return NSLocalizedString(@"NEW_NONCONTACT_CONVERSATION_VIEW_BUTTON", | ||
|  |         @"A label for the 'add by phone number' button in the 'new non-contact conversation' view"); | ||
|  | } | ||
|  | 
 | ||
|  | - (NSString *)contactsSectionTitle | ||
|  | { | ||
| 
											8 years ago
										 |     OWSFail(@"Method should never be called."); | ||
| 
											9 years ago
										 | 
 | ||
|  |     return nil; | ||
|  | } | ||
|  | 
 | ||
|  | - (void)phoneNumberWasSelected:(NSString *)phoneNumber | ||
|  | { | ||
|  |     OWSAssert(phoneNumber.length > 0); | ||
|  | 
 | ||
| 
											9 years ago
										 |     [self selectRecipient:phoneNumber]; | ||
| 
											9 years ago
										 | } | ||
|  | 
 | ||
|  | - (void)signalAccountWasSelected:(SignalAccount *)signalAccount | ||
|  | { | ||
|  |     OWSAssert(signalAccount); | ||
|  | 
 | ||
| 
											9 years ago
										 |     [self selectRecipient:signalAccount.recipientId]; | ||
| 
											9 years ago
										 | } | ||
|  | 
 | ||
|  | - (void)selectRecipient:(NSString *)recipientId | ||
|  | { | ||
|  |     OWSAssert(recipientId.length > 0); | ||
|  | 
 | ||
|  |     [self.nonContactConversationDelegate recipientIdWasSelected:recipientId]; | ||
|  | } | ||
|  | 
 | ||
|  | - (BOOL)shouldHideLocalNumber | ||
|  | { | ||
|  |     return NO; | ||
|  | } | ||
|  | 
 | ||
|  | - (BOOL)shouldHideContacts | ||
|  | { | ||
|  |     return YES; | ||
|  | } | ||
|  | 
 | ||
|  | - (BOOL)shouldValidatePhoneNumbers | ||
|  | { | ||
|  |     return YES; | ||
|  | } | ||
|  | 
 | ||
| 
											9 years ago
										 | - (BOOL)canSignalAccountBeSelected:(SignalAccount *)signalAccount | ||
|  | { | ||
| 
											8 years ago
										 |     OWSFail(@"Method should never be called."); | ||
| 
											9 years ago
										 | 
 | ||
|  |     return NO; | ||
|  | } | ||
|  | 
 | ||
|  | - (nullable NSString *)accessoryMessageForSignalAccount:(SignalAccount *)signalAccount | ||
|  | { | ||
| 
											8 years ago
										 |     OWSFail(@"Method should never be called."); | ||
| 
											9 years ago
										 | 
 | ||
|  |     return nil; | ||
|  | } | ||
|  | 
 | ||
| 
											9 years ago
										 | @end | ||
|  | 
 | ||
|  | NS_ASSUME_NONNULL_END |