From 1870ebd097c9e3789e345bf3f45d03739b43fa04 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Wed, 17 Apr 2024 21:20:51 +0400 Subject: [PATCH] Don't try to translate ads --- submodules/TelegramUI/Sources/ChatHistoryListNode.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/submodules/TelegramUI/Sources/ChatHistoryListNode.swift b/submodules/TelegramUI/Sources/ChatHistoryListNode.swift index 1cfaed2e0e..a40f2bb03d 100644 --- a/submodules/TelegramUI/Sources/ChatHistoryListNode.swift +++ b/submodules/TelegramUI/Sources/ChatHistoryListNode.swift @@ -2453,6 +2453,9 @@ public final class ChatHistoryListNodeImpl: ListView, ChatHistoryNode, ChatHisto for i in (wideIndexRange.0 ... wideIndexRange.1) { switch historyView.filteredEntries[i] { case let .MessageEntry(message, _, _, _, _, _): + guard message.adAttribute == nil && message.id.namespace == Namespaces.Message.Cloud else { + continue + } if !message.text.isEmpty && message.author?.id != self.context.account.peerId { if let translation = message.attributes.first(where: { $0 is TranslationMessageAttribute }) as? TranslationMessageAttribute, translation.toLang == translateToLanguage { } else { @@ -2461,6 +2464,9 @@ public final class ChatHistoryListNodeImpl: ListView, ChatHistoryNode, ChatHisto } case let .MessageGroupEntry(_, messages, _): for (message, _, _, _, _) in messages { + guard message.adAttribute && message.id.namespace == Namespaces.Message.Cloud == nil else { + continue + } if !message.text.isEmpty && message.author?.id != self.context.account.peerId { if let translation = message.attributes.first(where: { $0 is TranslationMessageAttribute }) as? TranslationMessageAttribute, translation.toLang == translateToLanguage { } else {