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
submodules
TelegramApi/Sources
TelegramCore/Sources/TelegramEngine/Calls

@ -9904,14 +9904,14 @@ public extension Api.functions.phone {
}
}
public extension Api.functions.phone {
static func deleteConferenceCallParticipants(call: Api.InputGroupCall, ids: [Api.InputPeer], block: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Updates>) {
static func deleteConferenceCallParticipants(call: Api.InputGroupCall, ids: [Int64], block: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Updates>) {
let buffer = Buffer()
buffer.appendInt32(585451463)
buffer.appendInt32(-115142380)
call.serialize(buffer, true)
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(ids.count))
for item in ids {
item.serialize(buffer, true)
serializeInt64(item, buffer: buffer, boxed: false)
}
serializeBytes(block, buffer: buffer, boxed: false)
return (FunctionDescription(name: "phone.deleteConferenceCallParticipants", parameters: [("call", String(describing: call)), ("ids", String(describing: ids)), ("block", String(describing: block))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? 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)
}
}