mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Refactoring
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import Foundation
|
||||
import Postbox
|
||||
import TelegramApi
|
||||
|
||||
import SyncCore
|
||||
|
||||
extension MessageNotificationSettings {
|
||||
init(apiSettings: Api.PeerNotifySettings) {
|
||||
switch apiSettings {
|
||||
case let .peerNotifySettings(_, showPreviews, _, muteUntil, sound):
|
||||
let displayPreviews: Bool
|
||||
if let showPreviews = showPreviews, case .boolFalse = showPreviews {
|
||||
displayPreviews = false
|
||||
} else {
|
||||
displayPreviews = true
|
||||
}
|
||||
self = MessageNotificationSettings(enabled: muteUntil == 0, displayPreviews: displayPreviews, sound: PeerMessageSound(apiSound: sound ?? "2"))
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user