From e0796a8f38c512ca1fb1f71aa455aebe1bf88f3a Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 13 Nov 2024 22:15:24 +0200 Subject: fix editing entry before posting it --- internal/platforms/linkedin/linkedin.go | 3 +-- internal/platforms/mastodon/mastodon.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'internal/platforms') diff --git a/internal/platforms/linkedin/linkedin.go b/internal/platforms/linkedin/linkedin.go index 39ca8cc..7db0e0d 100644 --- a/internal/platforms/linkedin/linkedin.go +++ b/internal/platforms/linkedin/linkedin.go @@ -58,7 +58,7 @@ func post(ctx context.Context, args config.Args, sizeLimit int, en entry.Entry) } question := fmt.Sprintf("Do you want to post this message to Linkedin (%v)?", prev) - if err := prompt.FileAction(question, content, en.Path); err != nil { + if content, err = prompt.FileAction(question, content, en.Path); err != nil { return err } @@ -86,7 +86,6 @@ func postMessageToLinkedInAPI(ctx context.Context, personID, accessToken, conten } article := map[string]interface{}{} - if thumbnailPath, ok := prev.Thumbnail(); ok { thumbnailURN, err := postImageToLinkedInAPI(ctx, personURN, accessToken, thumbnailPath) if err != nil { diff --git a/internal/platforms/mastodon/mastodon.go b/internal/platforms/mastodon/mastodon.go index c0264de..186623a 100644 --- a/internal/platforms/mastodon/mastodon.go +++ b/internal/platforms/mastodon/mastodon.go @@ -31,7 +31,7 @@ func Post(ctx context.Context, args config.Args, sizeLimit int, en entry.Entry) colour.Infoln("Not posting", en, "to Mastodon as dry-run enabled") return nil } - if err := prompt.FileAction("Do you want to post this message to Mastodon?", content, en.Path); err != nil { + if content, err = prompt.FileAction("Do you want to post this message to Mastodon?", content, en.Path); err != nil { return err } -- cgit v1.2.3