Rename CallStarter enum cases

This commit is contained in:
Max Radermacher 2024-10-09 14:46:38 -05:00 committed by GitHub
parent 1be997b523
commit 2c8a4b8f68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,9 +11,8 @@ import SignalRingRTC
/// checks are performed. See ``startCall(from:)`` for details of those checks.
struct CallStarter {
private enum Recipient {
// [CallLink] TODO: Rename these to avoid ambiguity with group calls.
case contact(thread: TSContactThread, withVideo: Bool)
case group(thread: TSGroupThread)
case contactThread(TSContactThread, withVideo: Bool)
case groupThread(TSGroupThread)
case callLink(CallLinkRootKey)
}
@ -45,12 +44,12 @@ struct CallStarter {
private var context: Context
init(contactThread: TSContactThread, withVideo: Bool, context: Context) {
self.recipient = .contact(thread: contactThread, withVideo: withVideo)
self.recipient = .contactThread(contactThread, withVideo: withVideo)
self.context = context
}
init(groupThread: TSGroupThread, context: Context) {
self.recipient = .group(thread: groupThread)
self.recipient = .groupThread(groupThread)
self.context = context
}
@ -80,11 +79,11 @@ struct CallStarter {
let callThread: TSThread?
let isVideoCall: Bool
switch recipient {
case .contact(let thread, let withVideo):
case .contactThread(let thread, let withVideo):
callTarget = .individual(thread)
callThread = thread
isVideoCall = withVideo
case .group(let thread):
case .groupThread(let thread):
callTarget = .groupThread(thread)
callThread = thread
isVideoCall = true