summaryrefslogtreecommitdiff
path: root/Hutch/Models
diff options
context:
space:
mode:
Diffstat (limited to 'Hutch/Models')
-rw-r--r--Hutch/Models/Inbox.swift8
1 files changed, 6 insertions, 2 deletions
diff --git a/Hutch/Models/Inbox.swift b/Hutch/Models/Inbox.swift
index c89cb12..8ab2480 100644
--- a/Hutch/Models/Inbox.swift
+++ b/Hutch/Models/Inbox.swift
@@ -52,10 +52,14 @@ struct InboxThreadSummary: Identifiable, Hashable, Sendable {
}
var threadGroupingKey: String {
- "\(listRID)#\(displaySubject.lowercased())"
+ "\(listRID)#\(Self.normalizationKey(for: subject))"
}
- private static func normalizedSubject(from subject: String) -> String {
+ nonisolated static func normalizationKey(for subject: String) -> String {
+ normalizedSubject(from: subject).lowercased()
+ }
+
+ private nonisolated static func normalizedSubject(from subject: String) -> String {
let collapsedWhitespace = subject
.replacingOccurrences(of: #"\s+"#, with: " ", options: .regularExpression)
.trimmingCharacters(in: .whitespacesAndNewlines)