diff --git a/Packages/Env/Sources/Env/PushNotificationsService.swift b/Packages/Env/Sources/Env/PushNotificationsService.swift index 80b7842d..7b220012 100644 --- a/Packages/Env/Sources/Env/PushNotificationsService.swift +++ b/Packages/Env/Sources/Env/PushNotificationsService.swift @@ -74,6 +74,8 @@ public class PushNotificationsService: ObservableObject { public func updateSubscriptions(accounts: [PushAccounts]) async { subscriptions = [] + let key = notificationsPrivateKeyAsKey.publicKey.x963Representation + let authKey = notificationsAuthKeyAsKey guard let pushToken = pushToken, isUserPushEnabled else { return } for account in accounts { let client = Client(server: account.server, oauthToken: account.token) @@ -87,8 +89,8 @@ public class PushNotificationsService: ObservableObject { #endif let sub: PushSubscription = try await client.post(endpoint: Push.createSub(endpoint: listenerURL, - p256dh: notificationsPrivateKeyAsKey.publicKey.x963Representation, - auth: notificationsAuthKeyAsKey, + p256dh: key, + auth: authKey, mentions: isMentionNotificationEnabled, status: isNewPostsNotificationEnabled, reblog: isReblogNotificationEnabled, diff --git a/Packages/Models/Sources/Models/MediaAttachement.swift b/Packages/Models/Sources/Models/MediaAttachement.swift index 939ed29a..3a98a513 100644 --- a/Packages/Models/Sources/Models/MediaAttachement.swift +++ b/Packages/Models/Sources/Models/MediaAttachement.swift @@ -11,7 +11,7 @@ public struct MediaAttachement: Codable, Identifiable, Hashable { } public enum SupportedType: String { - case image, gifv, video + case image, gifv, video, audio } public func hash(into hasher: inout Hasher) { diff --git a/Packages/Status/Sources/Status/Row/StatusMediaPreviewView.swift b/Packages/Status/Sources/Status/Row/StatusMediaPreviewView.swift index 3696ff5a..83a417a4 100644 --- a/Packages/Status/Sources/Status/Row/StatusMediaPreviewView.swift +++ b/Packages/Status/Sources/Status/Row/StatusMediaPreviewView.swift @@ -163,7 +163,7 @@ public struct StatusMediaPreviewView: View { .shimmering() }) } - case .gifv, .video: + case .gifv, .video, .audio: if let url = attachement.url { VideoPlayerView(viewModel: .init(url: url)) .frame(height: imageMaxHeight) @@ -209,7 +209,7 @@ public struct StatusMediaPreviewView: View { .cornerRadius(4) } } - case .gifv, .video: + case .gifv, .video, .audio: if let url = attachement.url { VideoPlayerView(viewModel: .init(url: url)) .frame(width: isNotifications ? imageMaxHeight : proxy.frame(in: .local).width)