mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Update API
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user