Fix visibility not being copied when replying

This commit is contained in:
Shadowfacts 2020-09-16 17:31:58 -04:00
parent 4719342a06
commit 184fe49c0f
Signed by untrusted user: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 4 additions and 0 deletions

View File

@ -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
}