Remove unused code
A couple of weird things left after the CallInitiator refactor: removed unused segue confusingly, call direction was *always* incoming, even for outgoing calls. But we weren't using it anyway. // FREEBIE
This commit is contained in:
parent
bf1ed9a277
commit
59059bc06c
@ -11,10 +11,6 @@ import PromiseKit
|
||||
@objc(OWSCallViewController)
|
||||
class CallViewController: UIViewController, CallObserver, CallServiceObserver, RTCEAGLVideoViewDelegate {
|
||||
|
||||
enum CallDirection {
|
||||
case unspecified, outgoing, incoming
|
||||
}
|
||||
|
||||
let TAG = "[CallViewController]"
|
||||
|
||||
// Dependencies
|
||||
@ -24,7 +20,6 @@ class CallViewController: UIViewController, CallObserver, CallServiceObserver, R
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
var callDirection: CallDirection = .unspecified
|
||||
var thread: TSContactThread!
|
||||
var call: SignalCall!
|
||||
|
||||
@ -139,17 +134,7 @@ class CallViewController: UIViewController, CallObserver, CallServiceObserver, R
|
||||
contactNameLabel.text = contactsManager.displayName(forPhoneIdentifier: thread.contactIdentifier())
|
||||
contactAvatarView.image = OWSAvatarBuilder.buildImage(for: thread, contactsManager: contactsManager)
|
||||
|
||||
switch callDirection {
|
||||
case .unspecified:
|
||||
Logger.error("\(TAG) must set call direction before call starts.")
|
||||
showCallFailed(error: OWSErrorMakeAssertionError())
|
||||
case .outgoing:
|
||||
self.call = self.callUIAdapter.startOutgoingCall(handle: thread.contactIdentifier())
|
||||
case .incoming:
|
||||
Logger.error("\(TAG) handling Incoming call")
|
||||
// No-op, since call service is already set up at this point, the result of which was presenting this viewController.
|
||||
}
|
||||
|
||||
assert(call != nil)
|
||||
// Subscribe for future call updates
|
||||
call.addObserverAndSyncState(observer: self)
|
||||
|
||||
@ -496,16 +481,6 @@ class CallViewController: UIViewController, CallObserver, CallServiceObserver, R
|
||||
|
||||
// MARK: - Methods
|
||||
|
||||
// objc accessible way to set our swift enum.
|
||||
func setOutgoingCallDirection() {
|
||||
callDirection = .outgoing
|
||||
}
|
||||
|
||||
// objc accessible way to set our swift enum.
|
||||
func setIncomingCallDirection() {
|
||||
callDirection = .incoming
|
||||
}
|
||||
|
||||
func showCallFailed(error: Error) {
|
||||
// TODO Show something in UI.
|
||||
Logger.error("\(TAG) call failed with error: \(error)")
|
||||
|
||||
@ -72,7 +72,6 @@
|
||||
|
||||
static NSTimeInterval const kTSMessageSentDateShowTimeInterval = 5 * 60;
|
||||
|
||||
static NSString *const OWSMessagesViewControllerSegueInitiateCall = @"initiateCallSegue";
|
||||
static NSString *const OWSMessagesViewControllerSegueShowFingerprint = @"fingerprintSegue";
|
||||
static NSString *const OWSMessagesViewControllerSeguePushConversationSettings =
|
||||
@"OWSMessagesViewControllerSeguePushConversationSettings";
|
||||
@ -1600,20 +1599,8 @@ typedef enum : NSUInteger {
|
||||
OWSConversationSettingsTableViewController *controller
|
||||
= (OWSConversationSettingsTableViewController *)segue.destinationViewController;
|
||||
[controller configureWithThread:self.thread];
|
||||
} else if ([segue.identifier isEqualToString:OWSMessagesViewControllerSegueInitiateCall]) {
|
||||
if (![segue.destinationViewController isKindOfClass:[OWSCallViewController class]]) {
|
||||
DDLogError(@"%@ Expected CallViewController but got: %@", self.tag, segue.destinationViewController);
|
||||
return;
|
||||
}
|
||||
|
||||
OWSCallViewController *callViewController = (OWSCallViewController *)segue.destinationViewController;
|
||||
|
||||
if (![self.thread isKindOfClass:[TSContactThread class]]) {
|
||||
DDLogError(@"%@ Unexpectedly trying to call in group thread:%@. This isn't supported.", self.thread, self.tag);
|
||||
return;
|
||||
}
|
||||
callViewController.thread = (TSContactThread *)self.thread;
|
||||
[callViewController setOutgoingCallDirection];
|
||||
} else {
|
||||
DDLogDebug(@"%@ Received segue: %@", self.tag, segue.identifier);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -519,7 +519,6 @@ NSString *const SignalsViewControllerSegueShowIncomingCall = @"ShowIncomingCallS
|
||||
return;
|
||||
}
|
||||
OWSCallViewController *callViewController = (OWSCallViewController *)segue.destinationViewController;
|
||||
[callViewController setIncomingCallDirection];
|
||||
|
||||
if (![sender isKindOfClass:[SignalCall class]]) {
|
||||
DDLogError(@"%@ expecting call segueu to be sent by a SignalCall, but found: %@", self.tag, sender);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user