summaryrefslogtreecommitdiff
path: root/internal/platforms/mastodon
diff options
context:
space:
mode:
Diffstat (limited to 'internal/platforms/mastodon')
-rw-r--r--internal/platforms/mastodon/mastodon.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/platforms/mastodon/mastodon.go b/internal/platforms/mastodon/mastodon.go
index a933ea6..361d1a5 100644
--- a/internal/platforms/mastodon/mastodon.go
+++ b/internal/platforms/mastodon/mastodon.go
@@ -9,6 +9,7 @@ import (
"codeberg.org/snonux/gos/internal/config"
"codeberg.org/snonux/gos/internal/entry"
+ "codeberg.org/snonux/gos/internal/prompt"
)
func Post(ctx context.Context, args config.Args, ent entry.Entry) error {
@@ -21,6 +22,9 @@ func Post(ctx context.Context, args config.Args, ent entry.Entry) error {
if err != nil {
return fmt.Errorf("failed to marshal payload: %w", err)
}
+ if !prompt.Yes(fmt.Sprintf("%s\nDo you want to post this message to Mastodon?", string(payloadBytes))) {
+ return prompt.ErrAborted
+ }
req, err := http.NewRequest("POST", args.Secrets.MastodonURL, bytes.NewBuffer(payloadBytes))
if err != nil {