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

@ -9904,14 +9904,14 @@ public extension Api.functions.phone {
} }
} }
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() let buffer = Buffer()
buffer.appendInt32(585451463) buffer.appendInt32(-115142380)
call.serialize(buffer, true) call.serialize(buffer, true)
buffer.appendInt32(481674261) buffer.appendInt32(481674261)
buffer.appendInt32(Int32(ids.count)) buffer.appendInt32(Int32(ids.count))
for item in ids { for item in ids {
item.serialize(buffer, true) serializeInt64(item, buffer: buffer, boxed: false)
} }
serializeBytes(block, 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 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

View File

@ -860,18 +860,7 @@ public enum RemoveGroupCallBlockchainParticipantsResult {
} }
func _internal_removeGroupCallBlockchainParticipants(account: Account, callId: Int64, accessHash: Int64, participantIds: [Int64], block: Data) -> Signal<RemoveGroupCallBlockchainParticipantsResult, NoError> { 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 account.network.request(Api.functions.phone.deleteConferenceCallParticipants(call: .inputGroupCall(id: callId, accessHash: accessHash), ids: participantIds, block: Buffer(data: block)))
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)
}
}
}
|> 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 |> map { updates -> RemoveGroupCallBlockchainParticipantsResult in
account.stateManager.addUpdates(updates) account.stateManager.addUpdates(updates)
return .success return .success
@ -880,7 +869,6 @@ func _internal_removeGroupCallBlockchainParticipants(account: Account, callId: I
return .single(.pollBlocksAndRetry) return .single(.pollBlocksAndRetry)
} }
} }
}
public struct JoinGroupCallAsScreencastResult { public struct JoinGroupCallAsScreencastResult {
public var jsonParams: String public var jsonParams: String