This repository was archived by the owner on Feb 21, 2024. It is now read-only.
Open
Conversation
Call was incorrectly passing a freshly initialised, empty request rather than the request data that the caller provided
Compile was failing on 32 bit linux
Author
|
Added a SendFile function, which is useful for sending files |
kegsay
reviewed
May 8, 2018
| } `json:"rooms"` | ||
| } | ||
|
|
||
| // RespTurnServer was written by someone else who later turned on the automatic commit checker so no-one could commit without writing this comment lol |
| Sender string `json:"sender"` // The user ID of the sender of the event | ||
| Type string `json:"type"` // The event type | ||
| Timestamp int `json:"origin_server_ts"` // The unix timestamp when this message was sent by the origin server | ||
| Timestamp int64 `json:"origin_server_ts"` // The unix timestamp when this message was sent by the origin server |
| func (cli *Client) InviteUser(roomID string, req *ReqInviteUser) (resp *RespInviteUser, err error) { | ||
| u := cli.BuildURL("rooms", roomID, "invite") | ||
| _, err = cli.MakeRequest("POST", u, struct{}{}, &resp) | ||
| _, err = cli.MakeRequest("POST", u, req, &resp) |
| // Download download a mxc url. Used to get sent file/photos/etc from the matrix server | ||
| func (cli *Client) Download(url string) (string, []byte, error) { | ||
| path := strings.Replace(url, "mxc://", "", 1) | ||
| req, _ := http.NewRequest("GET", cli.BuildBaseURL("_matrix/media/r0/download/"+path), nil) |
| } | ||
| defer res.Body.Close() | ||
|
|
||
| contents, err := ioutil.ReadAll(res.Body) |
Member
There was a problem hiding this comment.
Files may be large, it'd be nicer to return an io.ReadCloser!
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two fixes