Update API

This commit is contained in:
Ali
2023-10-05 14:21:24 +04:00
parent 015edbb686
commit c38cb154d7
20 changed files with 611 additions and 359 deletions

View File

@@ -37,13 +37,20 @@ func _internal_clearCloudDraftsInteractively(postbox: Postbox, network: Network,
_internal_updateChatInputState(transaction: transaction, peerId: key.peerId, threadId: key.threadId, inputState: nil)
if let peer = transaction.getPeer(key.peerId), let inputPeer = apiInputPeer(peer) {
var flags: Int32 = 0
var topMsgId: Int32?
if let threadId = key.threadId {
flags |= (1 << 2)
topMsgId = Int32(clamping: threadId)
}
signals.append(network.request(Api.functions.messages.saveDraft(flags: flags, replyToMsgId: nil, topMsgId: topMsgId, peer: inputPeer, message: "", entities: nil))
var flags: Int32 = 0
var replyTo: Api.InputReplyTo?
if let topMsgId = topMsgId {
flags |= (1 << 0)
var innerFlags: Int32 = 0
innerFlags |= 1 << 0
replyTo = .inputReplyToMessage(flags: innerFlags, replyToMsgId: 0, topMsgId: topMsgId, replyToPeerId: nil, quoteText: nil, quoteEntities: nil)
}
signals.append(network.request(Api.functions.messages.saveDraft(flags: flags, replyTo: replyTo, peer: inputPeer, message: "", entities: nil))
|> `catch` { _ -> Signal<Api.Bool, NoError> in
return .single(.boolFalse)
}