matrix-org / gomatrix

A Golang Matrix client
Apache License 2.0
285 stars 53 forks source link

Add support for specifying filename when uploading to content repo #70

Closed spaksa closed 2 years ago

spaksa commented 4 years ago

A bot I'm building needs to be able to set the filename for files uploaded to the content repo. Without these changes the download returns a file with the mediaid as filename and no extension.

t3chguy commented 4 years ago

this would be a breaking change

TheDiscordian commented 4 years ago

I suggest renaming the new method to (cli *Client) UploadToContentRepoWithName(content io.Reader, contentType string, contentLength int64, contentFilename string) (*RespMediaUpload, error), and change the old method to point to the new method to avoid code repetition. Seems useful.