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