Update API

This commit is contained in:
Ali 2022-11-05 00:18:06 +04:00
parent 38c0fd0bf2
commit 3fde9cf033
2 changed files with 5 additions and 9 deletions

View File

@ -2444,16 +2444,17 @@ public extension Api.functions.channels {
}
}
public extension Api.functions.channels {
static func reorderPinnedForumTopics(channel: Api.InputChannel, order: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Updates>) {
static func reorderPinnedForumTopics(flags: Int32, channel: Api.InputChannel, order: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Updates>) {
let buffer = Buffer()
buffer.appendInt32(-529811367)
buffer.appendInt32(693150095)
serializeInt32(flags, buffer: buffer, boxed: false)
channel.serialize(buffer, true)
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(order.count))
for item in order {
serializeInt32(item, buffer: buffer, boxed: false)
}
return (FunctionDescription(name: "channels.reorderPinnedForumTopics", parameters: [("channel", String(describing: channel)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in
return (FunctionDescription(name: "channels.reorderPinnedForumTopics", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in
let reader = BufferReader(buffer)
var result: Api.Updates?
if let signature = reader.readInt32() {

View File

@ -386,13 +386,8 @@ func _internal_setForumChannelPinnedTopics(account: Account, id: EnginePeer.Id,
return .fail(.generic)
}
#if DEBUG
if "".isEmpty {
return .complete()
}
#endif
return account.network.request(Api.functions.channels.reorderPinnedForumTopics(
flags: 1 << 0,
channel: inputChannel,
order: threadIds.map(Int32.init(clamping:))
))