2018-08-31 02:30:19 +00:00
|
|
|
//
|
|
|
|
// Visibility+String.swift
|
|
|
|
// Tusker
|
|
|
|
//
|
|
|
|
// Created by Shadowfacts on 8/29/18.
|
|
|
|
// Copyright © 2018 Shadowfacts. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2018-09-11 14:52:21 +00:00
|
|
|
import Pachyderm
|
2019-06-13 19:38:40 +00:00
|
|
|
import UIKit
|
2018-08-31 02:30:19 +00:00
|
|
|
|
2018-09-11 14:52:21 +00:00
|
|
|
extension Status.Visibility {
|
2018-08-31 02:30:19 +00:00
|
|
|
|
|
|
|
var displayName: String {
|
|
|
|
switch self {
|
|
|
|
case .public:
|
|
|
|
return "Public"
|
|
|
|
case .unlisted:
|
|
|
|
return "Unlisted"
|
|
|
|
case .private:
|
|
|
|
return "Private"
|
|
|
|
case .direct:
|
|
|
|
return "Direct"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-28 03:21:08 +00:00
|
|
|
var subtitle: String {
|
|
|
|
switch self {
|
|
|
|
case .public:
|
|
|
|
return "Everyone"
|
|
|
|
case .unlisted:
|
|
|
|
return "Hidden from public timelines"
|
|
|
|
case .private:
|
|
|
|
return "Followers only"
|
|
|
|
case .direct:
|
|
|
|
return "Mentioned users only"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-14 00:53:17 +00:00
|
|
|
var imageName: String {
|
2019-06-13 19:38:40 +00:00
|
|
|
switch self {
|
|
|
|
case .public:
|
2019-06-14 00:53:17 +00:00
|
|
|
return "globe"
|
2019-06-13 19:38:40 +00:00
|
|
|
case .unlisted:
|
2019-06-14 00:53:17 +00:00
|
|
|
return "lock.open.fill"
|
2019-06-13 19:38:40 +00:00
|
|
|
case .private:
|
2019-06-14 00:53:17 +00:00
|
|
|
return "lock.fill"
|
2019-06-13 19:38:40 +00:00
|
|
|
case .direct:
|
2019-06-14 00:53:17 +00:00
|
|
|
return "envelope.fill"
|
2019-06-13 19:38:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-17 03:00:39 +00:00
|
|
|
var unfilledImageName: String {
|
|
|
|
switch self {
|
|
|
|
case .public:
|
|
|
|
return "globe"
|
|
|
|
case .unlisted:
|
|
|
|
return "lock.open"
|
|
|
|
case .private:
|
|
|
|
return "lock"
|
|
|
|
case .direct:
|
|
|
|
return "envelope"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-31 02:30:19 +00:00
|
|
|
}
|
2022-11-05 16:20:30 +00:00
|
|
|
|
|
|
|
extension Status.Visibility: Comparable {
|
|
|
|
public static func < (lhs: Pachyderm.Status.Visibility, rhs: Pachyderm.Status.Visibility) -> Bool {
|
|
|
|
switch (lhs, rhs) {
|
|
|
|
case (.direct, .public), (.private, .public), (.unlisted, .public):
|
|
|
|
return true
|
|
|
|
case (.direct, .unlisted), (.private, .unlisted):
|
|
|
|
return true
|
|
|
|
case (.direct, .private):
|
|
|
|
return true
|
|
|
|
default:
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|