| 
						
						
						
					 | 
				
			
			 | 
			 | 
			
				@ -1,5 +1,5 @@
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				//
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				//  Copyright (c) 2018 Open Whisper Systems. All rights reserved.
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				//  Copyright (c) 2019 Open Whisper Systems. All rights reserved.
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				//
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				import Foundation
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -12,10 +12,13 @@ import Foundation
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        let alertTitle = NSLocalizedString("CALL_AUDIO_PERMISSION_TITLE", comment: "Alert title when calling and permissions for microphone are missing")
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        let alertMessage = NSLocalizedString("CALL_AUDIO_PERMISSION_MESSAGE", comment: "Alert message when calling and permissions for microphone are missing")
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        let alertController = UIAlertController(title: alertTitle, message: alertMessage, preferredStyle: .alert)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        let dismissAction = UIAlertAction(title: CommonStrings.dismissButton, style: .cancel)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        let dismissAction = UIAlertAction(title: CommonStrings.dismissButton, style: .cancel)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        dismissAction.accessibilityIdentifier = "OWSAlerts.\("dismiss")"
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        alertController.addAction(dismissAction)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if let settingsAction = CurrentAppContext().openSystemSettingsAction {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            settingsAction.accessibilityIdentifier = "OWSAlerts.\("settings")"
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            alertController.addAction(settingsAction)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        CurrentAppContext().frontmostViewController()?.present(alertController, animated: true, completion: nil)
 | 
			
		
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
			
			 | 
			 | 
			
				@ -51,10 +54,13 @@ import Foundation
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    @objc
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    public class func showAlert(title: String?, message: String? = nil, buttonTitle: String? = nil, buttonAction: ((UIAlertAction) -> Void)? = nil, fromViewController: UIViewController?) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        let actionTitle = buttonTitle ?? NSLocalizedString("OK", comment: "")
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        alert.addAction(UIAlertAction(title: actionTitle, style: .default, handler: buttonAction))
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        let actionTitle = buttonTitle ?? NSLocalizedString("OK", comment: "")
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        let okAction = UIAlertAction(title: actionTitle, style: .default, handler: buttonAction)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        okAction.accessibilityIdentifier = "OWSAlerts.\("ok")"
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        alert.addAction(okAction)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        fromViewController?.present(alert, animated: true, completion: nil)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -66,7 +72,9 @@ import Foundation
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        alert.addAction(self.cancelAction)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        let actionTitle = proceedTitle ?? NSLocalizedString("OK", comment: "")
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        alert.addAction(UIAlertAction(title: actionTitle, style: .default, handler: proceedAction))
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        let okAction = UIAlertAction(title: actionTitle, style: .default, handler: proceedAction)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        okAction.accessibilityIdentifier = "OWSAlerts.\("ok")"
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        alert.addAction(okAction)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        CurrentAppContext().frontmostViewController()?.present(alert, animated: true, completion: nil)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -82,6 +90,7 @@ import Foundation
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            Logger.debug("Cancel item")
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            // Do nothing.
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        action.accessibilityIdentifier = "OWSAlerts.\("cancel")"
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        return action
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
			
			 | 
			 | 
			
				
 
 |