Conference calls

This commit is contained in:
Isaac
2025-04-01 17:18:08 +04:00
parent b90065451b
commit 2393424bde
22 changed files with 579 additions and 136 deletions

View File

@@ -718,6 +718,23 @@ private final class CallSessionManagerContext {
}
}
func dropOutgoingConferenceRequest(messageId: MessageId) {
let addUpdates = self.addUpdates
let rejectSignal = self.network.request(Api.functions.phone.declineConferenceCallInvite(msgId: messageId.id))
|> map(Optional.init)
|> `catch` { _ -> Signal<Api.Updates?, NoError> in
return .single(nil)
}
|> mapToSignal { updates -> Signal<Never, NoError> in
if let updates {
addUpdates(updates)
}
return .complete()
}
self.rejectConferenceInvitationDisposables.add(rejectSignal.startStrict())
}
func drop(internalId: CallSessionInternalId, reason: DropCallReason, debugLog: Signal<String?, NoError>) {
for (id, context) in self.incomingConferenceInvitationContexts {
if context.internalId == internalId {
@@ -1383,6 +1400,12 @@ public final class CallSessionManager {
}
}
public func dropOutgoingConferenceRequest(messageId: MessageId) {
self.withContext { context in
context.dropOutgoingConferenceRequest(messageId: messageId)
}
}
func drop(stableId: CallSessionStableId, reason: DropCallReason) {
self.withContext { context in
context.drop(stableId: stableId, reason: reason)