Move joinState from IndivCall to SignalCall

This commit is contained in:
Marissa Le Coz 2023-11-17 16:19:56 -05:00 committed by GitHub
parent 0ce8a37dfe
commit 1581795cbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 29 deletions

View File

@ -194,34 +194,6 @@ public class IndividualCall: NSObject {
}
}
/// `JoinState` is a group call concept, but we want to bridge
/// between the two call types.
/// TODO: Continue to tweak this as we unify the individual and
/// group call UIs.
var joinState: JoinState {
switch self.state {
case .idle,
.remoteHangup,
.remoteHangupNeedPermission,
.localHangup,
.remoteRinging,
.localRinging_Anticipatory,
.localRinging_ReadyToAnswer,
.remoteBusy,
.localFailure,
.busyElsewhere,
.answeredElsewhere,
.declinedElsewhere:
return .notJoined
case .connected,
.accepting,
.answering,
.reconnecting,
.dialing:
return .joined
}
}
public var offerMediaType: TSRecentCallOfferType = .audio
// We start out muted if the record permission isn't granted. This should generally

View File

@ -128,7 +128,32 @@ public class SignalCall: NSObject, CallManagerCallReference {
public var joinState: JoinState {
switch mode {
case .individual(let call): return call.joinState
case .individual(let call):
/// `JoinState` is a group call concept, but we want to bridge
/// between the two call types.
/// TODO: Continue to tweak this as we unify the individual and
/// group call UIs.
switch call.state {
case .idle,
.remoteHangup,
.remoteHangupNeedPermission,
.localHangup,
.remoteRinging,
.localRinging_Anticipatory,
.localRinging_ReadyToAnswer,
.remoteBusy,
.localFailure,
.busyElsewhere,
.answeredElsewhere,
.declinedElsewhere:
return .notJoined
case .connected,
.accepting,
.answering,
.reconnecting,
.dialing:
return .joined
}
case .group(let call): return call.localDeviceState.joinState
}
}