mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Filter message events by namespace
This commit is contained in:
parent
c75bde7573
commit
55f8fd4535
@ -420,26 +420,29 @@ final class MutableMessageHistoryView {
|
||||
break
|
||||
}
|
||||
}
|
||||
if addCount == 2 && removeCount == 2 {
|
||||
assert(true)
|
||||
}
|
||||
for operation in operationSet {
|
||||
switch operation {
|
||||
case let .InsertMessage(message):
|
||||
if unwrappedTag.isEmpty || message.tags.contains(unwrappedTag) {
|
||||
if loadedState.add(entry: .IntermediateMessageEntry(message, nil, nil)) {
|
||||
hasChanges = true
|
||||
if self.namespaces.contains(message.id.namespace) {
|
||||
if loadedState.add(entry: .IntermediateMessageEntry(message, nil, nil)) {
|
||||
hasChanges = true
|
||||
}
|
||||
}
|
||||
}
|
||||
case let .Remove(indicesAndTags):
|
||||
for (index, _) in indicesAndTags {
|
||||
if loadedState.remove(index: index) {
|
||||
hasChanges = true
|
||||
if self.namespaces.contains(index.id.namespace) {
|
||||
if loadedState.remove(index: index) {
|
||||
hasChanges = true
|
||||
}
|
||||
}
|
||||
}
|
||||
case let .UpdateEmbeddedMedia(index, buffer):
|
||||
if loadedState.updateEmbeddedMedia(index: index, buffer: buffer) {
|
||||
hasChanges = true
|
||||
if self.namespaces.contains(index.id.namespace) {
|
||||
if loadedState.updateEmbeddedMedia(index: index, buffer: buffer) {
|
||||
hasChanges = true
|
||||
}
|
||||
}
|
||||
case let .UpdateGroupInfos(groupInfos):
|
||||
if loadedState.updateGroupInfo(mapping: groupInfos) {
|
||||
|
@ -330,9 +330,9 @@ final class ChatHistoryPreloadManager {
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
/*#if DEBUG
|
||||
#if DEBUG
|
||||
return
|
||||
#endif*/
|
||||
#endif
|
||||
|
||||
var indices: [(ChatHistoryPreloadIndex, Bool, Bool)] = []
|
||||
for entry in view.0.entries {
|
||||
|
Loading…
x
Reference in New Issue
Block a user