mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
24 lines
674 B
Swift
24 lines
674 B
Swift
import Foundation
|
|
#if os(macOS)
|
|
import PostboxMac
|
|
import SwiftSignalKitMac
|
|
import TelegramApiMac
|
|
#else
|
|
import Postbox
|
|
import SwiftSignalKit
|
|
import TelegramApi
|
|
#endif
|
|
|
|
import SyncCore
|
|
|
|
extension TelegramTheme {
|
|
convenience init?(apiTheme: Api.Theme) {
|
|
switch apiTheme {
|
|
case let .theme(flags, id, accessHash, slug, title, document, installCount):
|
|
self.init(id: id, accessHash: accessHash, slug: slug, title: title, file: document.flatMap(telegramMediaFileFromApiDocument), isCreator: (flags & 1 << 0) != 0, isDefault: (flags & 1 << 1) != 0, installCount: installCount)
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
}
|