Codes and ads improvements

This commit is contained in:
Ilya Laktyushin
2024-09-20 18:34:06 +04:00
parent 24ca7ba16e
commit 39b27018bd
7 changed files with 19 additions and 10 deletions

View File

@@ -7784,10 +7784,10 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
return false
}
})
} else if peerId.namespace == Namespaces.Peer.CloudUser && peerId.id._internalGetInt64Value() == 777000 {
} else if peerId.isTelegramNotifications {
self.screenCaptureManager = ScreenCaptureDetectionManager(check: { [weak self] in
if let strongSelf = self, strongSelf.traceVisibility() {
let loginCodeRegex = try? NSRegularExpression(pattern: "[\\d\\-]{5,7}", options: [])
let loginCodeRegex = try? NSRegularExpression(pattern: "\\b\\d{5,7}\\b", options: [])
var loginCodesToInvalidate: [String] = []
strongSelf.chatDisplayNode.historyNode.forEachVisibleMessageItemNode({ itemNode in
if let text = itemNode.item?.message.text, let matches = loginCodeRegex?.matches(in: text, options: [], range: NSMakeRange(0, (text as NSString).length)), let match = matches.first {