mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Fix build [skip ci]
This commit is contained in:
@@ -4,22 +4,23 @@ import Postbox
|
|||||||
import TelegramApi
|
import TelegramApi
|
||||||
import MtProtoKit
|
import MtProtoKit
|
||||||
|
|
||||||
public struct NotificationSoundSettings : Equatable {
|
public struct NotificationSoundSettings: Equatable {
|
||||||
public private(set) var maxDuration: Int = 5
|
public private(set) var maxDuration: Int = 5
|
||||||
public private(set) var maxSize: Int = 102400
|
public private(set) var maxSize: Int = 102400
|
||||||
public private(set) var maxSavedCount: Int = 100
|
public private(set) var maxSavedCount: Int = 100
|
||||||
|
|
||||||
private init(appConfiguration: AppConfiguration) {
|
private init(appConfiguration: AppConfiguration) {
|
||||||
var reasons: [String] = []
|
|
||||||
if let data = appConfiguration.data {
|
if let data = appConfiguration.data {
|
||||||
let duration = data["ringtone_duration_max"] as? Double ?? 5
|
let duration = data["ringtone_duration_max"] as? Double ?? 5
|
||||||
let size = data["ringtone_size_max"] as? Double ?? 102400
|
let size = data["ringtone_size_max"] as? Double ?? 102400
|
||||||
let count = data["ringtone_saved_count_max"] as? Double ?? 100
|
let count = data["ringtone_saved_count_max"] as? Double ?? 100
|
||||||
|
|
||||||
self.maxDuration = Int(duration) ?? 5
|
self.maxDuration = Int(duration)
|
||||||
self.maxSize = Int(size) ?? 102400
|
self.maxSize = Int(size)
|
||||||
self.maxSavedCount = Int(count) ?? 100
|
self.maxSavedCount = Int(count)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func extract(from appConfiguration: AppConfiguration) -> NotificationSoundSettings {
|
public static func extract(from appConfiguration: AppConfiguration) -> NotificationSoundSettings {
|
||||||
return self.init(appConfiguration: appConfiguration)
|
return self.init(appConfiguration: appConfiguration)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user