* Update copyright holding and dates * compound IDE Macros updated * update copyright * update copyrights done * update templates and README
48 lines
1.5 KiB
Swift
48 lines
1.5 KiB
Swift
//
|
|
// Copyright 2025 Element Creations Ltd.
|
|
// Copyright 2022-2025 New Vector Ltd.
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
// Please see LICENSE files in the repository root for full details.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
struct AdvancedSettingsScreenViewState: BindableState {
|
|
var timelineMediaVisibility: TimelineMediaVisibility
|
|
var hideInviteAvatars: Bool
|
|
var isWaitingTimelineMediaVisibility = false
|
|
var isWaitingHideInviteAvatars = false
|
|
var bindings: AdvancedSettingsScreenViewStateBindings
|
|
}
|
|
|
|
// periphery:ignore - subscript are seen as false positives
|
|
@dynamicMemberLookup
|
|
struct AdvancedSettingsScreenViewStateBindings {
|
|
private let advancedSettings: AdvancedSettingsProtocol
|
|
|
|
init(advancedSettings: AdvancedSettingsProtocol) {
|
|
self.advancedSettings = advancedSettings
|
|
}
|
|
|
|
subscript<Setting>(dynamicMember keyPath: ReferenceWritableKeyPath<AdvancedSettingsProtocol, Setting>) -> Setting {
|
|
get { advancedSettings[keyPath: keyPath] }
|
|
set { advancedSettings[keyPath: keyPath] = newValue }
|
|
}
|
|
}
|
|
|
|
enum AdvancedSettingsScreenViewAction {
|
|
case optimizeMediaUploadsChanged
|
|
case updateTimelineMediaVisibility(TimelineMediaVisibility)
|
|
case updateHideInviteAvatars(Bool)
|
|
}
|
|
|
|
protocol AdvancedSettingsProtocol: AnyObject {
|
|
var viewSourceEnabled: Bool { get set }
|
|
var appAppearance: AppAppearance { get set }
|
|
var sharePresence: Bool { get set }
|
|
var optimizeMediaUploads: Bool { get set }
|
|
}
|
|
|
|
extension AppSettings: AdvancedSettingsProtocol { }
|