mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Update API
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user