mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Ads and codes improvements
This commit is contained in:
@@ -221,6 +221,8 @@ public final class ChatMessageAttachedContentNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
|
||||
let isAd = message.adAttribute != nil
|
||||
|
||||
var isReplyThread = false
|
||||
if case .replyThread = chatLocation {
|
||||
isReplyThread = true
|
||||
@@ -352,7 +354,7 @@ public final class ChatMessageAttachedContentNode: ASDisplayNode {
|
||||
contentFileValue = file
|
||||
}
|
||||
|
||||
if shouldDownloadMediaAutomatically(settings: automaticDownloadSettings, peerType: associatedData.automaticDownloadPeerType, networkType: associatedData.automaticDownloadNetworkType, authorPeerId: message.author?.id, contactsPeerIds: associatedData.contactsPeerIds, media: file) {
|
||||
if shouldDownloadMediaAutomatically(settings: automaticDownloadSettings, peerType: associatedData.automaticDownloadPeerType, networkType: associatedData.automaticDownloadNetworkType, authorPeerId: message.author?.id, contactsPeerIds: associatedData.contactsPeerIds, media: file, isAd: isAd) {
|
||||
contentMediaAutomaticDownload = .full
|
||||
} else if shouldPredownloadMedia(settings: automaticDownloadSettings, peerType: associatedData.automaticDownloadPeerType, networkType: associatedData.automaticDownloadNetworkType, media: file) {
|
||||
contentMediaAutomaticDownload = .prefetch
|
||||
@@ -404,7 +406,7 @@ public final class ChatMessageAttachedContentNode: ASDisplayNode {
|
||||
} else {
|
||||
let contentMode: InteractiveMediaNodeContentMode = contentMediaAspectFilled ? .aspectFill : .aspectFit
|
||||
|
||||
let automaticDownload = shouldDownloadMediaAutomatically(settings: automaticDownloadSettings, peerType: associatedData.automaticDownloadPeerType, networkType: associatedData.automaticDownloadNetworkType, authorPeerId: message.author?.id, contactsPeerIds: associatedData.contactsPeerIds, media: contentMediaValue)
|
||||
let automaticDownload = shouldDownloadMediaAutomatically(settings: automaticDownloadSettings, peerType: associatedData.automaticDownloadPeerType, networkType: associatedData.automaticDownloadNetworkType, authorPeerId: message.author?.id, contactsPeerIds: associatedData.contactsPeerIds, media: contentMediaValue, isAd: isAd)
|
||||
|
||||
let (_, initialImageWidth, refineLayout) = makeContentMedia(
|
||||
context,
|
||||
@@ -435,7 +437,7 @@ public final class ChatMessageAttachedContentNode: ASDisplayNode {
|
||||
|
||||
let contentFileContinueLayout: ChatMessageInteractiveFileNode.ContinueLayout?
|
||||
if let contentFileValue {
|
||||
let automaticDownload = shouldDownloadMediaAutomatically(settings: automaticDownloadSettings, peerType: associatedData.automaticDownloadPeerType, networkType: associatedData.automaticDownloadNetworkType, authorPeerId: message.author?.id, contactsPeerIds: associatedData.contactsPeerIds, media: contentFileValue)
|
||||
let automaticDownload = shouldDownloadMediaAutomatically(settings: automaticDownloadSettings, peerType: associatedData.automaticDownloadPeerType, networkType: associatedData.automaticDownloadNetworkType, authorPeerId: message.author?.id, contactsPeerIds: associatedData.contactsPeerIds, media: contentFileValue, isAd: isAd)
|
||||
|
||||
let (_, refineLayout) = makeContentFile(ChatMessageInteractiveFileNode.Arguments(
|
||||
context: context,
|
||||
|
||||
Reference in New Issue
Block a user