Merge commit '7621e2f8dec938cf48181c8b10afc9b01f444e68' into beta

This commit is contained in:
Ilya Laktyushin
2025-12-06 02:17:48 +04:00
commit 8344b97e03
28070 changed files with 7995182 additions and 0 deletions
@@ -0,0 +1,68 @@
import Foundation
import UIKit
import TelegramCore
public extension TelegramWallpaper {
var isEmpty: Bool {
switch self {
case .image:
return false
case .emoticon:
return false
case let .file(file):
if self.isPattern, file.settings.colors.count == 1 && (file.settings.colors[0] == 0xffffff || file.settings.colors[0] == 0xffffffff) {
return true
} else {
return false
}
case let .color(color):
return color == 0xffffff || color == 0xffffffff
default:
return false
}
}
var isColorOrGradient: Bool {
switch self {
case .color, .gradient:
return true
default:
return false
}
}
var isPattern: Bool {
switch self {
case let .file(file):
return file.isPattern || file.file.mimeType == "application/x-tgwallpattern"
default:
return false
}
}
var isBuiltin: Bool {
switch self {
case .builtin:
return true
default:
return false
}
}
var isEmoticon: Bool {
switch self {
case .emoticon:
return true
default:
return false
}
}
var dimensions: CGSize? {
if case let .file(file) = self {
return file.file.dimensions?.cgSize
} else {
return nil
}
}
}