Prevent wallpaper archive thumbnail generation.

This commit is contained in:
Cody Henthorne
2025-10-29 11:51:14 -04:00
committed by jeffrey-signal
parent 4a163167e0
commit 5f5e0963e1
3 changed files with 22 additions and 22 deletions

View File

@@ -35,7 +35,7 @@ private fun AccountData.getAllReferencedArchiveAttachmentInfos(): Set<ArchiveAtt
}
private fun Chat.getAllReferencedArchiveAttachmentInfos(): Set<ArchiveAttachmentInfo> {
val info = this.style?.wallpaperPhoto?.toArchiveAttachmentInfo()
val info = this.style?.wallpaperPhoto?.toArchiveAttachmentInfo(isWallpaper = true)
return if (info != null) {
setOf(info)
@@ -73,7 +73,7 @@ private fun ChatItem.getAllReferencedArchiveAttachmentInfos(): Set<ArchiveAttach
return out ?: emptySet()
}
private fun FilePointer.toArchiveAttachmentInfo(forQuote: Boolean = false): ArchiveAttachmentInfo? {
private fun FilePointer.toArchiveAttachmentInfo(forQuote: Boolean = false, isWallpaper: Boolean = false): ArchiveAttachmentInfo? {
if (this.locatorInfo?.key == null) {
return null
}
@@ -87,7 +87,8 @@ private fun FilePointer.toArchiveAttachmentInfo(forQuote: Boolean = false): Arch
remoteKey = this.locatorInfo.key,
cdn = this.locatorInfo.mediaTierCdnNumber ?: Cdn.CDN_0.cdnNumber,
contentType = this.contentType,
forQuote = forQuote
forQuote = forQuote,
isWallpaper = isWallpaper
)
}
@@ -96,7 +97,8 @@ data class ArchiveAttachmentInfo(
val remoteKey: ByteString,
val cdn: Int,
val contentType: String?,
val forQuote: Boolean
val forQuote: Boolean,
val isWallpaper: Boolean = false
) {
val fullSizeMediaName: MediaName get() = MediaName.fromPlaintextHashAndRemoteKey(plaintextHash.toByteArray(), remoteKey.toByteArray())
val thumbnailMediaName: MediaName get() = MediaName.fromPlaintextHashAndRemoteKeyForThumbnail(plaintextHash.toByteArray(), remoteKey.toByteArray())