|
|
@ -31,7 +31,7 @@
|
|
|
|
#define CELL_HEIGHT 72.0f
|
|
|
|
#define CELL_HEIGHT 72.0f
|
|
|
|
#define HEADER_HEIGHT 44.0f
|
|
|
|
#define HEADER_HEIGHT 44.0f
|
|
|
|
|
|
|
|
|
|
|
|
NSString *const SignalsViewControllerSegueShowIncomingCall = @"ShowIncomingCallSegue";
|
|
|
|
// NSString *const SignalsViewControllerSegueShowIncomingCall = @"ShowIncomingCallSegue";
|
|
|
|
|
|
|
|
|
|
|
|
@interface SignalsViewController ()
|
|
|
|
@interface SignalsViewController ()
|
|
|
|
|
|
|
|
|
|
|
@ -195,12 +195,12 @@ NSString *const SignalsViewControllerSegueShowIncomingCall = @"ShowIncomingCallS
|
|
|
|
(self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable)) {
|
|
|
|
(self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable)) {
|
|
|
|
[self registerForPreviewingWithDelegate:self sourceView:self.tableView];
|
|
|
|
[self registerForPreviewingWithDelegate:self sourceView:self.tableView];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
|
|
// [[NSNotificationCenter defaultCenter] addObserver:self
|
|
|
|
selector:@selector(handleActiveCallNotification:)
|
|
|
|
// selector:@selector(handleActiveCallNotification:)
|
|
|
|
name:[CallService callServiceActiveCallNotificationName]
|
|
|
|
// name:[CallService callServiceActiveCallNotificationName]
|
|
|
|
object:nil];
|
|
|
|
// object:nil];
|
|
|
|
|
|
|
|
//
|
|
|
|
[self updateBarButtonItems];
|
|
|
|
[self updateBarButtonItems];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -260,29 +260,30 @@ NSString *const SignalsViewControllerSegueShowIncomingCall = @"ShowIncomingCallS
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- (void)handleActiveCallNotification:(NSNotification *)notification
|
|
|
|
//- (void)handleActiveCallNotification:(NSNotification *)notification
|
|
|
|
{
|
|
|
|
//{
|
|
|
|
AssertIsOnMainThread();
|
|
|
|
// // TODO insteead at the callsite lets present as topmost VC
|
|
|
|
|
|
|
|
// AssertIsOnMainThread();
|
|
|
|
if (![notification.object isKindOfClass:[SignalCall class]]) {
|
|
|
|
//
|
|
|
|
DDLogError(@"%@ expected presentCall observer to be notified with a SignalCall, but found %@",
|
|
|
|
// if (![notification.object isKindOfClass:[SignalCall class]]) {
|
|
|
|
self.tag,
|
|
|
|
// DDLogError(@"%@ expected presentCall observer to be notified with a SignalCall, but found %@",
|
|
|
|
notification.object);
|
|
|
|
// self.tag,
|
|
|
|
return;
|
|
|
|
// notification.object);
|
|
|
|
}
|
|
|
|
// return;
|
|
|
|
|
|
|
|
// }
|
|
|
|
SignalCall *call = (SignalCall *)notification.object;
|
|
|
|
//
|
|
|
|
|
|
|
|
// SignalCall *call = (SignalCall *)notification.object;
|
|
|
|
// Dismiss any other modals so we can present call modal.
|
|
|
|
//
|
|
|
|
if (self.presentedViewController) {
|
|
|
|
// // Dismiss any other modals so we can present call modal.
|
|
|
|
[self dismissViewControllerAnimated:YES
|
|
|
|
// if (self.presentedViewController) {
|
|
|
|
completion:^{
|
|
|
|
// [self dismissViewControllerAnimated:YES
|
|
|
|
[self performSegueWithIdentifier:SignalsViewControllerSegueShowIncomingCall sender:call];
|
|
|
|
// completion:^{
|
|
|
|
}];
|
|
|
|
// [self performSegueWithIdentifier:SignalsViewControllerSegueShowIncomingCall sender:call];
|
|
|
|
} else {
|
|
|
|
// }];
|
|
|
|
[self performSegueWithIdentifier:SignalsViewControllerSegueShowIncomingCall sender:call];
|
|
|
|
// } else {
|
|
|
|
}
|
|
|
|
// [self performSegueWithIdentifier:SignalsViewControllerSegueShowIncomingCall sender:call];
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
- (void)previewingContext:(id<UIViewControllerPreviewing>)previewingContext
|
|
|
|
- (void)previewingContext:(id<UIViewControllerPreviewing>)previewingContext
|
|
|
|
commitViewController:(UIViewController *)viewControllerToCommit {
|
|
|
|
commitViewController:(UIViewController *)viewControllerToCommit {
|
|
|
@ -727,25 +728,25 @@ NSString *const SignalsViewControllerSegueShowIncomingCall = @"ShowIncomingCallS
|
|
|
|
|
|
|
|
|
|
|
|
#pragma mark - Navigation
|
|
|
|
#pragma mark - Navigation
|
|
|
|
|
|
|
|
|
|
|
|
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
|
|
|
//- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
|
|
|
if ([segue.identifier isEqualToString:SignalsViewControllerSegueShowIncomingCall]) {
|
|
|
|
// if ([segue.identifier isEqualToString:SignalsViewControllerSegueShowIncomingCall]) {
|
|
|
|
DDLogDebug(@"%@ preparing for incoming call segue", self.tag);
|
|
|
|
// DDLogDebug(@"%@ preparing for incoming call segue", self.tag);
|
|
|
|
if (![segue.destinationViewController isKindOfClass:[OWSCallViewController class]]) {
|
|
|
|
// if (![segue.destinationViewController isKindOfClass:[OWSCallViewController class]]) {
|
|
|
|
DDLogError(@"%@ Received unexpected destination view controller: %@", self.tag, segue.destinationViewController);
|
|
|
|
// DDLogError(@"%@ Received unexpected destination view controller: %@", self.tag,
|
|
|
|
return;
|
|
|
|
// segue.destinationViewController); return;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
OWSCallViewController *callViewController = (OWSCallViewController *)segue.destinationViewController;
|
|
|
|
// OWSCallViewController *callViewController = (OWSCallViewController *)segue.destinationViewController;
|
|
|
|
|
|
|
|
//
|
|
|
|
if (![sender isKindOfClass:[SignalCall class]]) {
|
|
|
|
// if (![sender isKindOfClass:[SignalCall class]]) {
|
|
|
|
DDLogError(@"%@ expecting call segueu to be sent by a SignalCall, but found: %@", self.tag, sender);
|
|
|
|
// DDLogError(@"%@ expecting call segueu to be sent by a SignalCall, but found: %@", self.tag, sender);
|
|
|
|
return;
|
|
|
|
// return;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
SignalCall *call = (SignalCall *)sender;
|
|
|
|
// SignalCall *call = (SignalCall *)sender;
|
|
|
|
TSContactThread *thread = [TSContactThread getOrCreateThreadWithContactId:call.remotePhoneNumber];
|
|
|
|
// TSContactThread *thread = [TSContactThread getOrCreateThreadWithContactId:call.remotePhoneNumber];
|
|
|
|
callViewController.thread = thread;
|
|
|
|
// callViewController.thread = thread;
|
|
|
|
callViewController.call = call;
|
|
|
|
// callViewController.call = call;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
#pragma mark - IBAction
|
|
|
|
#pragma mark - IBAction
|
|
|
|
|
|
|
|
|
|
|
|