aa0a5fb356
- New WelcomeView gates first-run users with existing-account or signup paths - HostSignupClient posts to host.org-social.org /signup and auto-configures Settings - Show all relay feeds toggle (default off) restricts timeline to #+FOLLOW entries - Contextual empty-state in timeline routes to Discover or toggles relay-wide view - RootTab enum enables programmatic tab switching from child views - App icon background switched to cream for better contrast in iOS home screen - Remove pre-registered test account; fresh installs land on Welcome
52 lines
1.9 KiB
Swift
52 lines
1.9 KiB
Swift
import Foundation
|
|
|
|
/// Configuration for a timeline fetch.
|
|
public struct TimelineOptions: Sendable {
|
|
|
|
/// URL of the relay server.
|
|
/// Used only when `useRelay` is `true`.
|
|
public var relayURL: URL
|
|
|
|
/// When `true` (default), the timeline is built from all feeds known to the relay
|
|
/// instead of only the profile's `#+FOLLOW:` list. If the relay is unreachable,
|
|
/// the client falls back to the local follow list automatically.
|
|
///
|
|
/// Set to `false` to always use only the follows in the local profile.
|
|
public var useRelay: Bool
|
|
|
|
/// Maximum number of feeds downloaded in parallel.
|
|
public var maxConcurrentDownloads: Int
|
|
|
|
/// Only include posts newer than this many days. `nil` fetches all posts.
|
|
public var maxPostAgeDays: Int?
|
|
|
|
/// If non-empty, only posts whose `lang` matches one of these ISO 639-1
|
|
/// codes are included. An empty array (default) shows all languages.
|
|
public var languageFilter: [String]
|
|
|
|
/// When `false` (default), restrict the timeline to feeds listed in `#+FOLLOW:`
|
|
/// even if `useRelay` is `true`. Set to `true` to aggregate every feed known to
|
|
/// the relay (busier timeline, good for discovery).
|
|
public var showAllRelayFeeds: Bool
|
|
|
|
/// Default options: relay enabled, 20 concurrent downloads, 14-day cutoff,
|
|
/// all languages.
|
|
public static let `default` = TimelineOptions()
|
|
|
|
public init(
|
|
relayURL: URL = URL(string: "https://relay.org-social.org")!,
|
|
useRelay: Bool = true,
|
|
maxConcurrentDownloads: Int = 20,
|
|
maxPostAgeDays: Int? = 14,
|
|
languageFilter: [String] = [],
|
|
showAllRelayFeeds: Bool = false
|
|
) {
|
|
self.relayURL = relayURL
|
|
self.useRelay = useRelay
|
|
self.maxConcurrentDownloads = maxConcurrentDownloads
|
|
self.maxPostAgeDays = maxPostAgeDays
|
|
self.languageFilter = languageFilter
|
|
self.showAllRelayFeeds = showAllRelayFeeds
|
|
}
|
|
}
|