@@ -2619,14 +2619,14 @@ class ChatController: EditableViewController<ChatControllerView>, Notifable, Tab
2619
2619
if let suggest = presentation.interfaceState.suggestPost {
2620
2620
switch suggest.mode {
2621
2621
case let .edit(id), let .suggest(id):
2622
- reply = .init(messageId: id, quote: nil)
2622
+ reply = .init(messageId: id, quote: nil, todoItemId: nil )
2623
2623
default:
2624
2624
break
2625
2625
}
2626
2626
}
2627
2627
2628
2628
if reply == nil, let threadId64 = threadId64(), !presentation.isMonoforum {
2629
- reply = .init(messageId: MessageId(peerId: chatLocation().peerId, namespace: Namespaces.Message.Cloud, id: Int32(clamping: threadId64)), quote: nil)
2629
+ reply = .init(messageId: MessageId(peerId: chatLocation().peerId, namespace: Namespaces.Message.Cloud, id: Int32(clamping: threadId64)), quote: nil, todoItemId: nil )
2630
2630
}
2631
2631
return reply
2632
2632
}
@@ -5171,6 +5171,7 @@ class ChatController: EditableViewController<ChatControllerView>, Notifable, Tab
5171
5171
}
5172
5172
5173
5173
var fromIndex: MessageIndex?
5174
+ let innerId: Int32?
5174
5175
5175
5176
if let fromId = fromId, let message = strongSelf.messageInCurrentHistoryView(fromId) {
5176
5177
fromIndex = MessageIndex(message)
@@ -5179,6 +5180,11 @@ class ChatController: EditableViewController<ChatControllerView>, Notifable, Tab
5179
5180
fromIndex = MessageIndex(message)
5180
5181
}
5181
5182
}
5183
+ if let fromId = fromId, let message = strongSelf.messageInCurrentHistoryView(fromId) {
5184
+ innerId = message.replyAttribute?.todoItemId
5185
+ } else {
5186
+ innerId = nil
5187
+ }
5182
5188
if let fromIndex = fromIndex {
5183
5189
let historyView = preloadedChatHistoryViewForLocation(.InitialSearch(location: .id(focusTarget.messageId, focusTarget.string), count: strongSelf.requestCount), context: context, chatLocation: strongSelf.chatLocation, chatLocationContextHolder: strongSelf.chatLocationContextHolder, tag: strongSelf.locationValue?.tag, additionalData: [])
5184
5190
@@ -5212,7 +5218,7 @@ class ChatController: EditableViewController<ChatControllerView>, Notifable, Tab
5212
5218
let toIndex = MessageIndex(message)
5213
5219
let requestCount = strongSelf.requestCount
5214
5220
let scroll = state
5215
- .swap(to: ChatHistoryEntryId.message(message)).text(string: focusTarget.string)
5221
+ .swap(to: ChatHistoryEntryId.message(message)).text(string: focusTarget.string, innerId: innerId )
5216
5222
.focus(action: { [weak strongSelf] view in
5217
5223
if let strongSelf {
5218
5224
let content: ChatHistoryLocation = .Scroll(index: .message(toIndex), anchorIndex: .message(toIndex), sourceIndex: .message(fromIndex), scrollPosition: .none(nil), count: requestCount, animated: state.animated)
@@ -5670,7 +5676,7 @@ class ChatController: EditableViewController<ChatControllerView>, Notifable, Tab
5670
5676
let media = TelegramMediaContact(firstName: myPeer.firstName ?? "", lastName: myPeer.lastName ?? "", phoneNumber: myPeer.phone ?? "", peerId: myPeer.id, vCardData: nil)
5671
5677
let canSend = peer.canSendMessage(strongSelf.mode.isThreadMode, media: media, threadData: strongSelf.chatInteraction.presentation.threadInfo, cachedData: strongSelf.chatInteraction.presentation.cachedData)
5672
5678
if canSend {
5673
- _ = Sender.enqueue(message: EnqueueMessage.message(text: "", attributes: [], inlineStickers: [:], mediaReference: AnyMediaReference.standalone(media: media), threadId: threadId64(), replyToMessageId: replyId.flatMap { .init(messageId: $0, quote: nil) }, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: []), context: context, peerId: peerId).start(completed: scrollAfterSend)
5679
+ _ = Sender.enqueue(message: EnqueueMessage.message(text: "", attributes: [], inlineStickers: [:], mediaReference: AnyMediaReference.standalone(media: media), threadId: threadId64(), replyToMessageId: replyId.flatMap { .init(messageId: $0, quote: nil, todoItemId: nil ) }, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: []), context: context, peerId: peerId).start(completed: scrollAfterSend)
5674
5680
strongSelf.nextTransaction.set(handler: afterSentTransition)
5675
5681
}
5676
5682
}
@@ -8276,7 +8282,7 @@ class ChatController: EditableViewController<ChatControllerView>, Notifable, Tab
8276
8282
if message.requestsSetupReply {
8277
8283
if message.id != current.interfaceState.dismissedForceReplyId {
8278
8284
current = current.updatedInterfaceState({
8279
- $0.withUpdatedReplyMessageId(.init(messageId: message.id, quote: nil))
8285
+ $0.withUpdatedReplyMessageId(.init(messageId: message.id, quote: nil, todoItemId: nil ))
8280
8286
})
8281
8287
}
8282
8288
}
@@ -9211,7 +9217,7 @@ class ChatController: EditableViewController<ChatControllerView>, Notifable, Tab
9211
9217
let result:KeyHandlerResult = currentReplyId != nil ? .invoked : .rejected
9212
9218
let subject: EngineMessageReplySubject?
9213
9219
if let currentReplyId = currentReplyId {
9214
- subject = .init(messageId: currentReplyId.id, quote: nil)
9220
+ subject = .init(messageId: currentReplyId.id, quote: nil, todoItemId: nil )
9215
9221
} else {
9216
9222
subject = nil
9217
9223
}
@@ -9239,7 +9245,7 @@ class ChatController: EditableViewController<ChatControllerView>, Notifable, Tab
9239
9245
let result:KeyHandlerResult = currentReplyId != nil ? .invoked : .rejected
9240
9246
let subject: EngineMessageReplySubject?
9241
9247
if let currentReplyId = currentReplyId {
9242
- subject = .init(messageId: currentReplyId.id, quote: nil)
9248
+ subject = .init(messageId: currentReplyId.id, quote: nil, todoItemId: nil )
9243
9249
} else {
9244
9250
subject = nil
9245
9251
}
0 commit comments