mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Update API
This commit is contained in:
parent
2c32a62f6a
commit
c3c092967f
submodules
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user