Resolve more errors
This commit is contained in:
parent
05a16da189
commit
4c98c9cc85
|
@ -2221,13 +2221,13 @@
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
B82A0C0426B7B45200C1BCE3 /* Group */,
|
B82A0C0426B7B45200C1BCE3 /* Group */,
|
||||||
|
B82A0C1526B7B45200C1BCE3 /* Individual */,
|
||||||
B82A0C1026B7B45200C1BCE3 /* LocalVideoView.swift */,
|
B82A0C1026B7B45200C1BCE3 /* LocalVideoView.swift */,
|
||||||
B82A0C1126B7B45200C1BCE3 /* CallHeader.swift */,
|
B82A0C1126B7B45200C1BCE3 /* CallHeader.swift */,
|
||||||
B82A0C1226B7B45200C1BCE3 /* CallButton.swift */,
|
B82A0C1226B7B45200C1BCE3 /* CallButton.swift */,
|
||||||
B82A0C1326B7B45200C1BCE3 /* CallControls.swift */,
|
B82A0C1326B7B45200C1BCE3 /* CallControls.swift */,
|
||||||
B82A0C1426B7B45200C1BCE3 /* RemoteVideoView.h */,
|
B82A0C1426B7B45200C1BCE3 /* RemoteVideoView.h */,
|
||||||
B82A0C0F26B7B45200C1BCE3 /* RemoteVideoView.m */,
|
B82A0C0F26B7B45200C1BCE3 /* RemoteVideoView.m */,
|
||||||
B82A0C1526B7B45200C1BCE3 /* Individual */,
|
|
||||||
);
|
);
|
||||||
path = UserInterface;
|
path = UserInterface;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
@ -2252,9 +2252,9 @@
|
||||||
B82A0C1526B7B45200C1BCE3 /* Individual */ = {
|
B82A0C1526B7B45200C1BCE3 /* Individual */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
B82A0C1826B7B45200C1BCE3 /* CallKit */,
|
||||||
B82A0C1626B7B45200C1BCE3 /* NonCallKitCallUIAdaptee.swift */,
|
B82A0C1626B7B45200C1BCE3 /* NonCallKitCallUIAdaptee.swift */,
|
||||||
B82A0C1726B7B45200C1BCE3 /* IndividualCallViewController.swift */,
|
B82A0C1726B7B45200C1BCE3 /* IndividualCallViewController.swift */,
|
||||||
B82A0C1826B7B45200C1BCE3 /* CallKit */,
|
|
||||||
B82A0C1B26B7B45200C1BCE3 /* CallUIAdapter.swift */,
|
B82A0C1B26B7B45200C1BCE3 /* CallUIAdapter.swift */,
|
||||||
);
|
);
|
||||||
path = Individual;
|
path = Individual;
|
||||||
|
|
|
@ -27,7 +27,7 @@ protocol CallUIAdaptee {
|
||||||
func failCall(_ call: SignalCall, error: SignalCall.CallError)
|
func failCall(_ call: SignalCall, error: SignalCall.CallError)
|
||||||
func setIsMuted(call: SignalCall, isMuted: Bool)
|
func setIsMuted(call: SignalCall, isMuted: Bool)
|
||||||
func setHasLocalVideo(call: SignalCall, hasLocalVideo: Bool)
|
func setHasLocalVideo(call: SignalCall, hasLocalVideo: Bool)
|
||||||
func startAndShowOutgoingCall(address: SignalServiceAddress, hasLocalVideo: Bool)
|
func startAndShowOutgoingCall(address: String, hasLocalVideo: Bool)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shared default implementations
|
// Shared default implementations
|
||||||
|
@ -39,7 +39,7 @@ extension CallUIAdaptee {
|
||||||
let callViewController = IndividualCallViewController(call: call)
|
let callViewController = IndividualCallViewController(call: call)
|
||||||
callViewController.modalTransitionStyle = .crossDissolve
|
callViewController.modalTransitionStyle = .crossDissolve
|
||||||
|
|
||||||
OWSWindowManager.shared.startCall(callViewController)
|
OWSWindowManager.shared().startCall(callViewController)
|
||||||
}
|
}
|
||||||
|
|
||||||
internal func reportMissedCall(_ call: SignalCall, callerName: String) {
|
internal func reportMissedCall(_ call: SignalCall, callerName: String) {
|
||||||
|
@ -48,11 +48,11 @@ extension CallUIAdaptee {
|
||||||
notificationPresenter.presentMissedCall(call.individualCall, callerName: callerName)
|
notificationPresenter.presentMissedCall(call.individualCall, callerName: callerName)
|
||||||
}
|
}
|
||||||
|
|
||||||
internal func startAndShowOutgoingCall(address: SignalServiceAddress, hasLocalVideo: Bool) {
|
internal func startAndShowOutgoingCall(address: String, hasLocalVideo: Bool) {
|
||||||
AssertIsOnMainThread()
|
AssertIsOnMainThread()
|
||||||
|
|
||||||
guard let call = self.callService.buildOutgoingIndividualCallIfPossible(
|
guard let call = self.callService.buildOutgoingIndividualCallIfPossible(
|
||||||
address: address,
|
publicKey: address,
|
||||||
hasVideo: hasLocalVideo
|
hasVideo: hasLocalVideo
|
||||||
) else {
|
) else {
|
||||||
// @integration This is not unexpected, it could happen if Bob tries
|
// @integration This is not unexpected, it could happen if Bob tries
|
||||||
|
@ -140,12 +140,13 @@ public class CallUIAdapter: NSObject, CallServiceObserver {
|
||||||
internal func reportIncomingCall(_ call: SignalCall, thread: TSContactThread) {
|
internal func reportIncomingCall(_ call: SignalCall, thread: TSContactThread) {
|
||||||
AssertIsOnMainThread()
|
AssertIsOnMainThread()
|
||||||
|
|
||||||
Logger.info("remoteAddress: \(call.individualCall.remoteAddress)")
|
Logger.info("remoteAddress: \(call.individualCall.publicKey)")
|
||||||
|
|
||||||
// make sure we don't terminate audio session during call
|
// make sure we don't terminate audio session during call
|
||||||
_ = audioSession.startAudioActivity(call.audioActivity)
|
_ = audioSession.startAudioActivity(call.audioActivity)
|
||||||
|
|
||||||
let callerName = self.contactsManager.displayName(for: call.individualCall.remoteAddress)
|
let publicKey = call.individualCall.publicKey
|
||||||
|
let callerName = Storage.shared.getContact(with: publicKey)?.displayName(for: .regular) ?? publicKey
|
||||||
|
|
||||||
Logger.verbose("callerName: \(callerName)")
|
Logger.verbose("callerName: \(callerName)")
|
||||||
|
|
||||||
|
@ -181,7 +182,8 @@ public class CallUIAdapter: NSObject, CallServiceObserver {
|
||||||
internal func reportMissedCall(_ call: SignalCall) {
|
internal func reportMissedCall(_ call: SignalCall) {
|
||||||
AssertIsOnMainThread()
|
AssertIsOnMainThread()
|
||||||
|
|
||||||
let callerName = self.contactsManager.displayName(for: call.individualCall.remoteAddress)
|
let publicKey = call.individualCall.publicKey
|
||||||
|
let callerName = Storage.shared.getContact(with: publicKey)?.displayName(for: .regular) ?? publicKey
|
||||||
adaptee(for: call).reportMissedCall(call, callerName: callerName)
|
adaptee(for: call).reportMissedCall(call, callerName: callerName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,7 +215,7 @@ public class CallUIAdapter: NSObject, CallServiceObserver {
|
||||||
adaptee(for: call).answerCall(call)
|
adaptee(for: call).answerCall(call)
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc public func startAndShowOutgoingCall(address: SignalServiceAddress, hasLocalVideo: Bool) {
|
@objc public func startAndShowOutgoingCall(address: String, hasLocalVideo: Bool) {
|
||||||
AssertIsOnMainThread()
|
AssertIsOnMainThread()
|
||||||
|
|
||||||
defaultAdaptee.startAndShowOutgoingCall(address: address, hasLocalVideo: hasLocalVideo)
|
defaultAdaptee.startAndShowOutgoingCall(address: address, hasLocalVideo: hasLocalVideo)
|
||||||
|
|
|
@ -66,8 +66,7 @@ class IndividualCallViewController: OWSViewController, CallObserver, CallAudioSe
|
||||||
// MARK: - Contact Views
|
// MARK: - Contact Views
|
||||||
|
|
||||||
private lazy var contactNameLabel = MarqueeLabel()
|
private lazy var contactNameLabel = MarqueeLabel()
|
||||||
private lazy var contactAvatarView = ConversationAvatarView(diameterPoints: 200,
|
private lazy var profilePictureView = ProfilePictureView()
|
||||||
localUserDisplayMode: .asUser)
|
|
||||||
private lazy var contactAvatarContainerView = UIView.container()
|
private lazy var contactAvatarContainerView = UIView.container()
|
||||||
private lazy var callStatusLabel = UILabel()
|
private lazy var callStatusLabel = UILabel()
|
||||||
private lazy var backButton = UIButton()
|
private lazy var backButton = UIButton()
|
||||||
|
@ -217,6 +216,10 @@ class IndividualCallViewController: OWSViewController, CallObserver, CallAudioSe
|
||||||
self.shouldUseTheme = false
|
self.shouldUseTheme = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
required init?(coder: NSCoder) {
|
||||||
|
preconditionFailure()
|
||||||
|
}
|
||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
// These views might be in the return to call PIP's hierarchy,
|
// These views might be in the return to call PIP's hierarchy,
|
||||||
// we want to remove them so they are free'd when the call ends
|
// we want to remove them so they are free'd when the call ends
|
||||||
|
@ -394,13 +397,8 @@ class IndividualCallViewController: OWSViewController, CallObserver, CallAudioSe
|
||||||
|
|
||||||
topGradientView.addSubview(callStatusLabel)
|
topGradientView.addSubview(callStatusLabel)
|
||||||
|
|
||||||
contactAvatarContainerView.addSubview(contactAvatarView)
|
contactAvatarContainerView.addSubview(profilePictureView)
|
||||||
view.insertSubview(contactAvatarContainerView, belowSubview: localVideoView)
|
view.insertSubview(contactAvatarContainerView, belowSubview: localVideoView)
|
||||||
|
|
||||||
backButton.accessibilityIdentifier = UIView.accessibilityIdentifier(in: self, name: "leaveCallViewButton")
|
|
||||||
contactNameLabel.accessibilityIdentifier = UIView.accessibilityIdentifier(in: self, name: "contactNameLabel")
|
|
||||||
callStatusLabel.accessibilityIdentifier = UIView.accessibilityIdentifier(in: self, name: "callStatusLabel")
|
|
||||||
contactAvatarView.accessibilityIdentifier = UIView.accessibilityIdentifier(in: self, name: "contactAvatarView")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func createOngoingCallControls() {
|
func createOngoingCallControls() {
|
||||||
|
@ -497,12 +495,7 @@ class IndividualCallViewController: OWSViewController, CallObserver, CallAudioSe
|
||||||
|
|
||||||
@objc
|
@objc
|
||||||
func updateAvatarImage() {
|
func updateAvatarImage() {
|
||||||
databaseStorage.read { transaction in
|
profilePictureView.update(for: thread.contactSessionID())
|
||||||
contactAvatarView.configure(thread: thread, transaction: transaction)
|
|
||||||
backgroundAvatarView.image = contactsManagerImpl.avatarImage(forAddress: thread.contactAddress,
|
|
||||||
shouldValidate: true,
|
|
||||||
transaction: transaction)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func createIncomingCallControls() {
|
func createIncomingCallControls() {
|
||||||
|
@ -600,7 +593,11 @@ class IndividualCallViewController: OWSViewController, CallObserver, CallAudioSe
|
||||||
contactAvatarContainerView.autoPinEdge(.bottom, to: .top, of: ongoingAudioCallControls, withOffset: -avatarMargin)
|
contactAvatarContainerView.autoPinEdge(.bottom, to: .top, of: ongoingAudioCallControls, withOffset: -avatarMargin)
|
||||||
contactAvatarContainerView.autoPinWidthToSuperview(withMargin: avatarMargin)
|
contactAvatarContainerView.autoPinWidthToSuperview(withMargin: avatarMargin)
|
||||||
|
|
||||||
contactAvatarView.autoCenterInSuperview()
|
let size = Values.smallProfilePictureSize
|
||||||
|
profilePictureView.size = size
|
||||||
|
profilePictureView.set(.width, to: size)
|
||||||
|
profilePictureView.set(.height, to: size)
|
||||||
|
profilePictureView.autoCenterInSuperview()
|
||||||
|
|
||||||
ongoingAudioCallControls.autoPinEdge(toSuperviewEdge: .top, withInset: gradientMargin)
|
ongoingAudioCallControls.autoPinEdge(toSuperviewEdge: .top, withInset: gradientMargin)
|
||||||
incomingVideoCallControls.autoPinEdge(toSuperviewEdge: .top)
|
incomingVideoCallControls.autoPinEdge(toSuperviewEdge: .top)
|
||||||
|
@ -843,7 +840,7 @@ class IndividualCallViewController: OWSViewController, CallObserver, CallAudioSe
|
||||||
let hasRemoteVideo = !remoteVideoView.isHidden
|
let hasRemoteVideo = !remoteVideoView.isHidden
|
||||||
remoteVideoView.isFullScreen = true
|
remoteVideoView.isFullScreen = true
|
||||||
remoteVideoView.isScreenShare = call.individualCall.isRemoteSharingScreen
|
remoteVideoView.isScreenShare = call.individualCall.isRemoteSharingScreen
|
||||||
contactAvatarView.isHidden = hasRemoteVideo || isRenderingLocalVanityVideo
|
profilePictureView.isHidden = hasRemoteVideo || isRenderingLocalVanityVideo
|
||||||
|
|
||||||
// Layout controls immediately to avoid spurious animation.
|
// Layout controls immediately to avoid spurious animation.
|
||||||
for controls in [incomingVideoCallControls, incomingAudioCallControls, ongoingAudioCallControls, ongoingVideoCallControls] {
|
for controls in [incomingVideoCallControls, incomingAudioCallControls, ongoingAudioCallControls, ongoingVideoCallControls] {
|
||||||
|
@ -1289,7 +1286,7 @@ extension IndividualCallViewController: UIGestureRecognizerDelegate {
|
||||||
extension IndividualCallViewController: CallViewControllerWindowReference {
|
extension IndividualCallViewController: CallViewControllerWindowReference {
|
||||||
var remoteVideoViewReference: UIView { remoteVideoView }
|
var remoteVideoViewReference: UIView { remoteVideoView }
|
||||||
var localVideoViewReference: UIView { localVideoView }
|
var localVideoViewReference: UIView { localVideoView }
|
||||||
var remoteVideoAddress: SignalServiceAddress { thread.contactAddress }
|
var remoteVideoAddress: String { thread.contactSessionID() }
|
||||||
|
|
||||||
@objc
|
@objc
|
||||||
public func returnFromPip(pipWindow: UIWindow) {
|
public func returnFromPip(pipWindow: UIWindow) {
|
||||||
|
|
Loading…
Reference in New Issue