Filter draft events

This commit is contained in:
isaac 2026-04-29 21:22:51 +04:00
parent fefea439ba
commit 53ed837123

View file

@ -1069,28 +1069,30 @@ final class MutableMessageHistoryView: MutablePostboxView {
}
}
switch self.peerIds {
case let .single(peerId, threadId):
let location = PeerAndThreadId(peerId: peerId, threadId: threadId)
if let typingDraftUpdate = transaction.updatedTypingDrafts[location] {
if let typingDraft = typingDraftUpdate.value, self.namespaces.contains(typingDraft.namespace) {
self.typingDraft = self.renderTypingDraft(postbox: postbox, typingDraft: typingDraft)
} else {
self.typingDraft = nil
if self.tag == nil {
switch self.peerIds {
case let .single(peerId, threadId):
let location = PeerAndThreadId(peerId: peerId, threadId: threadId)
if let typingDraftUpdate = transaction.updatedTypingDrafts[location] {
if let typingDraft = typingDraftUpdate.value, self.namespaces.contains(typingDraft.namespace) {
self.typingDraft = self.renderTypingDraft(postbox: postbox, typingDraft: typingDraft)
} else {
self.typingDraft = nil
}
hasChanges = true
}
hasChanges = true
case .external:
break
case .associated:
break
}
case .external:
break
case .associated:
break
}
return hasChanges
}
private func reloadTypingDraft(postbox: PostboxImpl) {
guard case let .single(peerId, threadId) = self.peerIds else {
guard case let .single(peerId, threadId) = self.peerIds, self.tag == nil else {
self.typingDraft = nil
return
}