Use attachment file name as description
Pleroma 2 no longer does it automatically.
This commit is contained in:
parent
ac342dde07
commit
3ac95ab3b1
|
@ -91,7 +91,12 @@ func (c *Client) doAPI(ctx context.Context, method string, uri string, params in
|
||||||
|
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
mw := multipart.NewWriter(&buf)
|
mw := multipart.NewWriter(&buf)
|
||||||
part, err := mw.CreateFormFile("file", filepath.Base(file.Filename))
|
fname := filepath.Base(file.Filename)
|
||||||
|
err = mw.WriteField("description", fname)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
part, err := mw.CreateFormFile("file", fname)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue