diff --git a/README b/README index 14261d7..5a0e5c1 100644 --- a/README +++ b/README @@ -12,6 +12,7 @@ Changes (localhost_custom fork): - visible edited post time - visible quoted post (status in status) - visible profile banner in spoiler +- add media description submit (very woozy way, but it works as possible) - add schedule status - add language input form - add expiry status diff --git a/mastodon/status.go b/mastodon/status.go index 064ffd0..af1910c 100644 --- a/mastodon/status.go +++ b/mastodon/status.go @@ -431,7 +431,7 @@ func (c *Client) Search(ctx context.Context, q string, qType string, limit int, return &results, nil } -func (c *Client) UploadMediaFromMultipartFileHeader(ctx context.Context, fh *multipart.FileHeader) (*Attachment, error) { +func (c *Client) UploadMediaFromMultipartFileHeader(ctx context.Context, fh *multipart.FileHeader, descr string) (*Attachment, error) { f, err := fh.Open() if err != nil { return nil, err @@ -441,7 +441,7 @@ func (c *Client) UploadMediaFromMultipartFileHeader(ctx context.Context, fh *mul var buf bytes.Buffer mw := multipart.NewWriter(&buf) fname := filepath.Base(fh.Filename) - err = mw.WriteField("description", fname) + err = mw.WriteField("description", descr) if err != nil { return nil, err } diff --git a/renderer/renderer.go b/renderer/renderer.go index 34046ba..d2409d7 100644 --- a/renderer/renderer.go +++ b/renderer/renderer.go @@ -76,6 +76,14 @@ func generatePollOptions() string { return pollbuilder } +func generateMediaDescrForm() string { + var mediadescrbuilder string + for i := 0; i < 20; i++ { + mediadescrbuilder = mediadescrbuilder + `
` + } + return mediadescrbuilder +} + var quoteRE = regexp.MustCompile("(?mU)(^|> *|\n)(>.*)(