mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Refactoring
This commit is contained in:
@@ -470,7 +470,6 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
||||
|
||||
private let messageProcessingManager = ChatMessageThrottledProcessingManager()
|
||||
private let adSeenProcessingManager = ChatMessageThrottledProcessingManager()
|
||||
private let messageReactionsProcessingManager = ChatMessageThrottledProcessingManager()
|
||||
private let seenLiveLocationProcessingManager = ChatMessageThrottledProcessingManager()
|
||||
private let unsupportedMessageProcessingManager = ChatMessageThrottledProcessingManager()
|
||||
private let refreshMediaProcessingManager = ChatMessageThrottledProcessingManager()
|
||||
@@ -631,9 +630,6 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
||||
}
|
||||
}
|
||||
}
|
||||
self.messageReactionsProcessingManager.process = { [weak context] messageIds in
|
||||
context?.account.viewTracker.updateReactionsForMessageIds(messageIds: messageIds)
|
||||
}
|
||||
self.seenLiveLocationProcessingManager.process = { [weak context] messageIds in
|
||||
context?.account.viewTracker.updateSeenLiveLocationForMessageIds(messageIds: messageIds)
|
||||
}
|
||||
@@ -1503,7 +1499,6 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
||||
|
||||
var messageIdsWithViewCount: [MessageId] = []
|
||||
var messageIdsWithAds: [MessageId] = []
|
||||
var messageIdsWithUpdateableReactions: [MessageId] = []
|
||||
var messageIdsWithLiveLocation: [MessageId] = []
|
||||
var messageIdsWithUnsupportedMedia: [MessageId] = []
|
||||
var messageIdsWithRefreshMedia: [MessageId] = []
|
||||
@@ -1541,7 +1536,6 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
||||
contentRequiredValidation = true
|
||||
}
|
||||
}
|
||||
var isAction = false
|
||||
for media in message.media {
|
||||
if let _ = media as? TelegramMediaUnsupported {
|
||||
contentRequiredValidation = true
|
||||
@@ -1550,8 +1544,6 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
||||
if message.timestamp + liveBroadcastingTimeout > timestamp {
|
||||
messageIdsWithLiveLocation.append(message.id)
|
||||
}
|
||||
} else if let _ = media as? TelegramMediaAction {
|
||||
isAction = true
|
||||
} else if let telegramFile = media as? TelegramMediaFile {
|
||||
if telegramFile.isAnimatedSticker, (message.id.peerId.namespace == Namespaces.Peer.SecretChat || !telegramFile.previewRepresentations.isEmpty), let size = telegramFile.size, size > 0 && size <= 128 * 1024 {
|
||||
if message.id.peerId.namespace == Namespaces.Peer.SecretChat {
|
||||
@@ -1572,9 +1564,6 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
||||
}
|
||||
}
|
||||
}
|
||||
if !isAction && message.id.peerId.namespace == Namespaces.Peer.CloudChannel {
|
||||
messageIdsWithUpdateableReactions.append(message.id)
|
||||
}
|
||||
if contentRequiredValidation {
|
||||
messageIdsWithUnsupportedMedia.append(message.id)
|
||||
}
|
||||
@@ -1703,9 +1692,6 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
||||
if !messageIdsWithAds.isEmpty {
|
||||
self.adSeenProcessingManager.add(messageIdsWithAds)
|
||||
}
|
||||
if !messageIdsWithUpdateableReactions.isEmpty {
|
||||
self.messageReactionsProcessingManager.add(messageIdsWithUpdateableReactions)
|
||||
}
|
||||
if !messageIdsWithLiveLocation.isEmpty {
|
||||
self.seenLiveLocationProcessingManager.add(messageIdsWithLiveLocation)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user