Filter draft events
This commit is contained in:
parent
fefea439ba
commit
53ed837123
1 changed files with 16 additions and 14 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue