From 125f91257a04f8a58e3e9850a911f6af4656f199 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 24 Jan 2023 20:43:43 -0500 Subject: [PATCH] Fix status notifications not being shown --- .../Pachyderm/Sources/Pachyderm/Model/Notification.swift | 5 +---- .../Sources/Pachyderm/Utilities/NotificationGroup.swift | 5 +++-- .../Notifications/NotificationsPageViewController.swift | 4 +++- .../Notifications/NotificationsTableViewController.swift | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Packages/Pachyderm/Sources/Pachyderm/Model/Notification.swift b/Packages/Pachyderm/Sources/Pachyderm/Model/Notification.swift index 67d2d52f..405d89e0 100644 --- a/Packages/Pachyderm/Sources/Pachyderm/Model/Notification.swift +++ b/Packages/Pachyderm/Sources/Pachyderm/Model/Notification.swift @@ -21,10 +21,6 @@ public class Notification: Decodable { self.id = try container.decode(String.self, forKey: .id) if let kind = try? container.decode(Kind.self, forKey: .kind) { self.kind = kind - } else if let s = try? container.decode(String.self, forKey: .kind), - s == "status" { - // represent notifications of other people posting as regular mentions for now - self.kind = .mention } else { self.kind = .unknown } @@ -57,6 +53,7 @@ extension Notification { case followRequest = "follow_request" case poll case update + case status case unknown } } diff --git a/Packages/Pachyderm/Sources/Pachyderm/Utilities/NotificationGroup.swift b/Packages/Pachyderm/Sources/Pachyderm/Utilities/NotificationGroup.swift index 655a930a..82e01d74 100644 --- a/Packages/Pachyderm/Sources/Pachyderm/Utilities/NotificationGroup.swift +++ b/Packages/Pachyderm/Sources/Pachyderm/Utilities/NotificationGroup.swift @@ -19,9 +19,10 @@ public struct NotificationGroup: Identifiable, Hashable { self.notifications = notifications self.id = notifications.first!.id self.kind = notifications.first!.kind - if kind == .mention { + switch kind { + case .mention, .status: self.statusState = .unknown - } else { + default: self.statusState = nil } } diff --git a/Tusker/Screens/Notifications/NotificationsPageViewController.swift b/Tusker/Screens/Notifications/NotificationsPageViewController.swift index 1819143e..3f2f84c3 100644 --- a/Tusker/Screens/Notifications/NotificationsPageViewController.swift +++ b/Tusker/Screens/Notifications/NotificationsPageViewController.swift @@ -72,7 +72,9 @@ class NotificationsPageViewController: SegmentedPageViewController