Copy local-only status from replied-to post

Closes #280
This commit is contained in:
Shadowfacts 2022-12-04 14:03:12 -05:00
parent 2e21742264
commit 669404d6f8
1 changed files with 3 additions and 0 deletions

View File

@ -177,6 +177,7 @@ extension MastodonController {
var acctsToMention = [String]() var acctsToMention = [String]()
var visibility = inReplyToID != nil ? Preferences.shared.defaultReplyVisibility.resolved : Preferences.shared.defaultPostVisibility var visibility = inReplyToID != nil ? Preferences.shared.defaultReplyVisibility.resolved : Preferences.shared.defaultPostVisibility
var localOnly = false
var contentWarning = "" var contentWarning = ""
if let inReplyToID = inReplyToID, if let inReplyToID = inReplyToID,
@ -184,6 +185,7 @@ extension MastodonController {
acctsToMention.append(inReplyTo.account.acct) acctsToMention.append(inReplyTo.account.acct)
acctsToMention.append(contentsOf: inReplyTo.mentions.map(\.acct)) acctsToMention.append(contentsOf: inReplyTo.mentions.map(\.acct))
visibility = min(visibility, inReplyTo.visibility) visibility = min(visibility, inReplyTo.visibility)
localOnly = instanceFeatures.localOnlyPosts && inReplyTo.localOnly
if !inReplyTo.spoilerText.isEmpty { if !inReplyTo.spoilerText.isEmpty {
switch Preferences.shared.contentWarningCopyMode { switch Preferences.shared.contentWarningCopyMode {
@ -213,6 +215,7 @@ extension MastodonController {
draft.text = acctsToMention.map { "@\($0) " }.joined() draft.text = acctsToMention.map { "@\($0) " }.joined()
draft.initialText = draft.text draft.initialText = draft.text
draft.visibility = visibility draft.visibility = visibility
draft.localOnly = localOnly
draft.contentWarning = contentWarning draft.contentWarning = contentWarning
draft.contentWarningEnabled = !contentWarning.isEmpty draft.contentWarningEnabled = !contentWarning.isEmpty