forked from shadowfacts/Tusker
parent
6e5e0c3bb5
commit
eb496243c7
|
@ -11,6 +11,8 @@ public struct Preferences: Codable, Sendable {
|
|||
public let postingDefaultVisibility: Visibility
|
||||
public let postingDefaultSensitive: Bool
|
||||
public let postingDefaultLanguage: String
|
||||
// Whether posts federate or not (local-only) on Hometown
|
||||
public let postingDefaultFederation: Bool?
|
||||
public let readingExpandMedia: ExpandMedia
|
||||
public let readingExpandSpoilers: Bool
|
||||
public let readingAutoplayGifs: Bool
|
||||
|
@ -19,6 +21,7 @@ public struct Preferences: Codable, Sendable {
|
|||
case postingDefaultVisibility = "posting:default:visibility"
|
||||
case postingDefaultSensitive = "posting:default:sensitive"
|
||||
case postingDefaultLanguage = "posting:default:language"
|
||||
case postingDefaultFederation = "posting:default:federation"
|
||||
case readingExpandMedia = "reading:expand:media"
|
||||
case readingExpandSpoilers = "reading:expand:spoilers"
|
||||
case readingAutoplayGifs = "reading:autoplay:gifs"
|
||||
|
|
|
@ -64,7 +64,7 @@ class ShareViewController: UIViewController {
|
|||
inReplyToID: nil,
|
||||
visibility: visibility,
|
||||
language: serverPrefs?.postingDefaultLanguage,
|
||||
localOnly: false
|
||||
localOnly: !(serverPrefs?.postingDefaultFederation ?? true)
|
||||
)
|
||||
|
||||
for attachment in await attachments {
|
||||
|
|
|
@ -370,6 +370,7 @@ class MastodonController: ObservableObject {
|
|||
}
|
||||
accountPreferences!.serverDefaultLanguage = prefs.postingDefaultLanguage
|
||||
accountPreferences!.serverDefaultVisibility = prefs.postingDefaultVisibility
|
||||
accountPreferences!.serverDefaultFederation = prefs.postingDefaultFederation ?? true
|
||||
}
|
||||
|
||||
private func updateActiveInstance(from instance: Instance) {
|
||||
|
@ -538,7 +539,7 @@ class MastodonController: ObservableObject {
|
|||
} else {
|
||||
Preferences.shared.defaultPostVisibility.resolved(withServerDefault: accountPreferences!.serverDefaultVisibility)
|
||||
}
|
||||
var localOnly = false
|
||||
var localOnly = instanceFeatures.localOnlyPosts && !accountPreferences!.serverDefaultFederation
|
||||
var contentWarning = ""
|
||||
|
||||
if let inReplyToID = inReplyToID,
|
||||
|
|
|
@ -24,6 +24,7 @@ public final class AccountPreferences: NSManagedObject {
|
|||
@NSManaged public var accountID: String
|
||||
@NSManaged var createdAt: Date
|
||||
@NSManaged var pinnedTimelinesData: Data?
|
||||
@NSManaged var serverDefaultFederation: Bool
|
||||
@NSManaged var serverDefaultLanguage: String?
|
||||
@NSManaged private var serverDefaultVisibilityString: String?
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
<attribute name="accountID" optional="YES" attributeType="String"/>
|
||||
<attribute name="createdAt" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
|
||||
<attribute name="pinnedTimelinesData" optional="YES" attributeType="Binary"/>
|
||||
<attribute name="serverDefaultFederation" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES"/>
|
||||
<attribute name="serverDefaultLanguage" optional="YES" attributeType="String"/>
|
||||
<attribute name="serverDefaultVisibilityString" optional="YES" attributeType="String"/>
|
||||
</entity>
|
||||
|
@ -157,4 +158,4 @@
|
|||
<memberEntity name="Account"/>
|
||||
<memberEntity name="ActiveInstance"/>
|
||||
</configuration>
|
||||
</model>
|
||||
</model>
|
Loading…
Reference in New Issue