Update API

This commit is contained in:
Isaac
2025-03-31 00:41:33 +04:00
parent 2c32a62f6a
commit c3c092967f
2 changed files with 9 additions and 21 deletions

View File

@@ -860,25 +860,13 @@ public enum RemoveGroupCallBlockchainParticipantsResult {
}
func _internal_removeGroupCallBlockchainParticipants(account: Account, callId: Int64, accessHash: Int64, participantIds: [Int64], block: Data) -> Signal<RemoveGroupCallBlockchainParticipantsResult, NoError> {
return account.postbox.transaction { transaction -> [Api.InputPeer] in
return participantIds.map { participantId in
let participantPeerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(participantId))
if let peer = transaction.getPeer(participantPeerId).flatMap(apiInputPeer) {
return peer
} else {
return .inputPeerUser(userId: participantId, accessHash: 0)
}
}
return account.network.request(Api.functions.phone.deleteConferenceCallParticipants(call: .inputGroupCall(id: callId, accessHash: accessHash), ids: participantIds, block: Buffer(data: block)))
|> map { updates -> RemoveGroupCallBlockchainParticipantsResult in
account.stateManager.addUpdates(updates)
return .success
}
|> mapToSignal { inputUsers -> Signal<RemoveGroupCallBlockchainParticipantsResult, NoError> in
return account.network.request(Api.functions.phone.deleteConferenceCallParticipants(call: .inputGroupCall(id: callId, accessHash: accessHash), ids: inputUsers, block: Buffer(data: block)))
|> map { updates -> RemoveGroupCallBlockchainParticipantsResult in
account.stateManager.addUpdates(updates)
return .success
}
|> `catch` { _ -> Signal<RemoveGroupCallBlockchainParticipantsResult, NoError> in
return .single(.pollBlocksAndRetry)
}
|> `catch` { _ -> Signal<RemoveGroupCallBlockchainParticipantsResult, NoError> in
return .single(.pollBlocksAndRetry)
}
}