From 184fe49c0f318ad59a72f4654bca3b6c85483558 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Wed, 16 Sep 2020 17:31:58 -0400 Subject: [PATCH] Fix visibility not being copied when replying --- Tusker/Models/Draft.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tusker/Models/Draft.swift b/Tusker/Models/Draft.swift index ac9089fc..c35cd22c 100644 --- a/Tusker/Models/Draft.swift +++ b/Tusker/Models/Draft.swift @@ -119,10 +119,13 @@ extension MastodonController { func createDraft(inReplyToID: String? = nil, mentioningAcct: String? = nil) -> Draft { var acctsToMention = [String]() + var visibility = Preferences.shared.defaultPostVisibility + if let inReplyToID = inReplyToID, let inReplyTo = persistentContainer.status(for: inReplyToID) { acctsToMention.append(inReplyTo.account.acct) acctsToMention.append(contentsOf: inReplyTo.mentions.map(\.acct)) + visibility = inReplyTo.visibility } if let mentioningAcct = mentioningAcct { acctsToMention.append(mentioningAcct) @@ -136,6 +139,7 @@ extension MastodonController { draft.inReplyToID = inReplyToID draft.text = acctsToMention.map { "@\($0) " }.joined() draft.initialText = draft.text + draft.visibility = visibility return draft }