From 0fff33928e4c193b530eb81d9f00cd2aa1f15dcf Mon Sep 17 00:00:00 2001 From: Robert Swain Date: Thu, 1 Jun 2017 17:56:30 +0200 Subject: [PATCH] vendor: Bump gomatrixserverlib to pull in CreateMediaDownloadRequest --- vendor/manifest | 2 +- .../github.com/matrix-org/gomatrixserverlib/client.go | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/vendor/manifest b/vendor/manifest index e76c66cc..b5725ca3 100644 --- a/vendor/manifest +++ b/vendor/manifest @@ -98,7 +98,7 @@ { "importpath": "github.com/matrix-org/gomatrixserverlib", "repository": "https://github.com/matrix-org/gomatrixserverlib", - "revision": "c396ef3cc1e546729f7052f1f48e345cc59269f4", + "revision": "b1dfcb3b345cc8410f1a03fec0a1ffe6bd002dcd", "branch": "master" }, { diff --git a/vendor/src/github.com/matrix-org/gomatrixserverlib/client.go b/vendor/src/github.com/matrix-org/gomatrixserverlib/client.go index 40c9ebe4..7d322f93 100644 --- a/vendor/src/github.com/matrix-org/gomatrixserverlib/client.go +++ b/vendor/src/github.com/matrix-org/gomatrixserverlib/client.go @@ -220,3 +220,14 @@ func (fc *Client) LookupServerKeys( } return result, nil } + +// CreateMediaDownloadRequest creates a request for media on a homeserver and returns the http.Response or an error +func (fc *Client) CreateMediaDownloadRequest(matrixServer ServerName, mediaID string) (*http.Response, error) { + requestURL := "matrix://" + string(matrixServer) + "/_matrix/media/v1/download/" + string(matrixServer) + "/" + mediaID + resp, err := fc.client.Get(requestURL) + if err != nil { + return nil, err + } + + return resp, nil +}