Skip to content

Commit

Permalink
Extract method
Browse files Browse the repository at this point in the history
Issue #389
  • Loading branch information
eofster committed Oct 11, 2017
1 parent a6054c3 commit bd501a5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Telephone/CallController.m
Expand Up @@ -384,6 +384,12 @@ - (BOOL)shouldShowViewController:(NSViewController *)viewController {
return ![self.callInfoView isEqual:viewController.view];
}

- (void)showUserNotificationIfNeeded {
if (![NSApp isActive] && ![self isCallUnhandled]) {
[self showUserNotification];
}
}

- (void)showUserNotification {
NSString *notificationTitle;
if ([[self nameFromAddressBook] length] > 0) {
Expand Down Expand Up @@ -537,10 +543,8 @@ - (void)SIPCallDidDisconnect:(NSNotification *)notification {
repeats:NO];

[self.musicPlayer resume];

if (![NSApp isActive] && ![self isCallUnhandled]) {
[self showUserNotification];
}

[self showUserNotificationIfNeeded];

// Optionally close disconnected call window.
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
Expand Down

0 comments on commit bd501a5

Please sign in to comment.