Compare commits

...

2 Commits

Author SHA1 Message Date
Shadowfacts 669404d6f8 Copy local-only status from replied-to post
Closes #280
2022-12-04 14:03:12 -05:00
Shadowfacts 2e21742264 Add Cmd+Enter keyboard shortcut for sending post
Closes #283
2022-12-04 14:01:09 -05:00
2 changed files with 4 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

View File

@ -231,6 +231,7 @@ struct ComposeView: View {
} label: { } label: {
Text("Post") Text("Post")
} }
.keyboardShortcut(.return, modifiers: .command)
.disabled(!postButtonEnabled) .disabled(!postButtonEnabled)
} }