summaryrefslogtreecommitdiff
path: root/internal/platforms/mastodon/mastodon.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-10-18 21:36:54 +0300
committerPaul Buetow <paul@buetow.org>2024-10-18 21:36:54 +0300
commitee2cb360bfb6ab35cb8a373fd1237993cea168d0 (patch)
treecb44f8ec411124f5aa18edc895e0a1860c680d69 /internal/platforms/mastodon/mastodon.go
parenta98fbd68214b9d99c425fb073051da790b0b15d0 (diff)
initial work on editing a post
Diffstat (limited to 'internal/platforms/mastodon/mastodon.go')
-rw-r--r--internal/platforms/mastodon/mastodon.go11
1 files changed, 2 insertions, 9 deletions
diff --git a/internal/platforms/mastodon/mastodon.go b/internal/platforms/mastodon/mastodon.go
index 390de4c..d4f9e7b 100644
--- a/internal/platforms/mastodon/mastodon.go
+++ b/internal/platforms/mastodon/mastodon.go
@@ -27,16 +27,9 @@ func Post(ctx context.Context, args config.Args, sizeLimit int, ent entry.Entry)
log.Println("Not posting", ent, "to Mastodon as dry-run enabled")
return nil
}
- switch prompt.DoYouWantThis("Do you want to post this message to Mastodon?", content) {
- case prompt.No:
- return prompt.ErrAborted
- case prompt.Yes:
- case prompt.Edit:
- panic("edit not yet implemented") // TODO
- default:
- panic("should never happen")
+ if err := prompt.DoYouWantThis("Do you want to post this message to Mastodon?", content); err != nil {
+ return err
}
-
req, err := http.NewRequestWithContext(ctx, "POST", args.Secrets.MastodonURL, bytes.NewBuffer(payloadBytes))
if err != nil {
return fmt.Errorf("failed to create request: %w", err)