Swiftgram/submodules/TelegramUI/Sources/WallpaperPreviewMedia.swift
Peter Iakovlev e9a4a9347a Revert "Rename directories [skip ci]"
This reverts commit 789438a27450dcbdee6065ebf096198ed3b90fec
2020-03-01 10:06:51 +00:00

49 lines
1.1 KiB
Swift

import Foundation
import UIKit
import Postbox
import TelegramCore
import SyncCore
enum WallpaperPreviewMediaContent: Equatable {
case file(TelegramMediaFile, UIColor?, UIColor?, Int32?, Bool, Bool)
case color(UIColor)
case gradient(UIColor, UIColor, Int32?)
case themeSettings(TelegramThemeSettings)
}
final class WallpaperPreviewMedia: Media {
var id: MediaId? {
return nil
}
let peerIds: [PeerId] = []
let content: WallpaperPreviewMediaContent
init(content: WallpaperPreviewMediaContent) {
self.content = content
}
init(decoder: PostboxDecoder) {
self.content = .color(.clear)
}
func encode(_ encoder: PostboxEncoder) {
}
public func isEqual(to other: Media) -> Bool {
guard let other = other as? WallpaperPreviewMedia else {
return false
}
if self.content != other.content {
return false
}
return true
}
public func isSemanticallyEqual(to other: Media) -> Bool {
return self.isEqual(to: other)
}
}