summaryrefslogtreecommitdiff
path: root/Hutch/Views/Inbox/InboxThreadUtilities.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Hutch/Views/Inbox/InboxThreadUtilities.swift')
-rw-r--r--Hutch/Views/Inbox/InboxThreadUtilities.swift11
1 files changed, 11 insertions, 0 deletions
diff --git a/Hutch/Views/Inbox/InboxThreadUtilities.swift b/Hutch/Views/Inbox/InboxThreadUtilities.swift
new file mode 100644
index 0000000..1dd88a3
--- /dev/null
+++ b/Hutch/Views/Inbox/InboxThreadUtilities.swift
@@ -0,0 +1,11 @@
+import Foundation
+
+enum InboxThreadUtilities {
+ nonisolated static func deriveRepositoryName(from listName: String) -> String? {
+ let separators = ["-devel", "-patches", "-dev", ".patches"]
+ for separator in separators where listName.hasSuffix(separator) {
+ return String(listName.dropLast(separator.count))
+ }
+ return nil
+ }
+}