mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-08-19 12:27:18 +02:00
Update Ghostgram features
This commit is contained in:
@@ -6,7 +6,8 @@ import TelegramApi
|
||||
extension TelegramPeerNotificationSettings {
|
||||
convenience init(apiSettings: Api.PeerNotifySettings) {
|
||||
switch apiSettings {
|
||||
case let .peerNotifySettings(_, showPreviews, _, muteUntil, iosSound, _, desktopSound, storiesMuted, storiesHideSender, storiesIosSound, _, storiesDesktopSound):
|
||||
case let .peerNotifySettings(peerNotifySettingsData):
|
||||
let (showPreviews, muteUntil, iosSound, desktopSound, storiesMuted, storiesHideSender, storiesIosSound, storiesDesktopSound) = (peerNotifySettingsData.showPreviews, peerNotifySettingsData.muteUntil, peerNotifySettingsData.iosSound, peerNotifySettingsData.otherSound, peerNotifySettingsData.storiesMuted, peerNotifySettingsData.storiesHideSender, peerNotifySettingsData.storiesIosSound, peerNotifySettingsData.storiesOtherSound)
|
||||
let sound: Api.NotificationSound?
|
||||
let storiesSound: Api.NotificationSound?
|
||||
#if os(iOS)
|
||||
@@ -68,7 +69,8 @@ extension PeerMessageSound {
|
||||
self = .default
|
||||
case .notificationSoundNone:
|
||||
self = .none
|
||||
case let .notificationSoundLocal(_, data):
|
||||
case let .notificationSoundLocal(notificationSoundLocalData):
|
||||
let (_, data) = (notificationSoundLocalData.title, notificationSoundLocalData.data)
|
||||
var rawApiSound = data
|
||||
if let index = rawApiSound.firstIndex(of: ".") {
|
||||
rawApiSound = String(rawApiSound[..<index])
|
||||
@@ -94,7 +96,8 @@ extension PeerMessageSound {
|
||||
}
|
||||
}
|
||||
self = parsedSound
|
||||
case let .notificationSoundRingtone(id):
|
||||
case let .notificationSoundRingtone(notificationSoundRingtoneData):
|
||||
let id = notificationSoundRingtoneData.id
|
||||
self = .cloud(fileId: id)
|
||||
}
|
||||
}
|
||||
@@ -107,12 +110,12 @@ extension PeerMessageSound {
|
||||
return .notificationSoundDefault
|
||||
case let .bundledModern(id):
|
||||
let string = "\(id + 100)"
|
||||
return .notificationSoundLocal(title: string, data: string)
|
||||
return .notificationSoundLocal(.init(title: string, data: string))
|
||||
case let .bundledClassic(id):
|
||||
let string = "\(id + 2)"
|
||||
return .notificationSoundLocal(title: string, data: string)
|
||||
return .notificationSoundLocal(.init(title: string, data: string))
|
||||
case let .cloud(fileId):
|
||||
return .notificationSoundRingtone(id: fileId)
|
||||
return .notificationSoundRingtone(.init(id: fileId))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user