diff options
author | Wim <wim@42.be> | 2022-04-01 00:23:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-01 00:23:19 +0200 |
commit | c6716e030c02f316b887c1d3ee4b443aa3ab6afd (patch) | |
tree | 470461fe2d29662e7a69834ed21fce30beed65ab /vendor/go.mau.fi/whatsmeow/upload.go | |
parent | 4ab72acec656dafd304f88359b509b1f27c06604 (diff) | |
download | matterbridge-msglm-c6716e030c02f316b887c1d3ee4b443aa3ab6afd.tar.gz matterbridge-msglm-c6716e030c02f316b887c1d3ee4b443aa3ab6afd.tar.bz2 matterbridge-msglm-c6716e030c02f316b887c1d3ee4b443aa3ab6afd.zip |
Update dependencies (#1784)
Diffstat (limited to 'vendor/go.mau.fi/whatsmeow/upload.go')
-rw-r--r-- | vendor/go.mau.fi/whatsmeow/upload.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vendor/go.mau.fi/whatsmeow/upload.go b/vendor/go.mau.fi/whatsmeow/upload.go index 6de805c6..b3e71cc4 100644 --- a/vendor/go.mau.fi/whatsmeow/upload.go +++ b/vendor/go.mau.fi/whatsmeow/upload.go @@ -87,7 +87,8 @@ func (cli *Client) Upload(ctx context.Context, plaintext []byte, appInfo MediaTy fileEncSHA256 := sha256.Sum256(dataToUpload) resp.FileEncSHA256 = fileEncSHA256[:] - err = cli.refreshMediaConn(false) + var mediaConn *MediaConn + mediaConn, err = cli.refreshMediaConn(false) if err != nil { err = fmt.Errorf("failed to refresh media connections: %w", err) return @@ -95,13 +96,13 @@ func (cli *Client) Upload(ctx context.Context, plaintext []byte, appInfo MediaTy token := base64.URLEncoding.EncodeToString(resp.FileEncSHA256) q := url.Values{ - "auth": []string{cli.mediaConn.Auth}, + "auth": []string{mediaConn.Auth}, "token": []string{token}, } mmsType := mediaTypeToMMSType[appInfo] uploadURL := url.URL{ Scheme: "https", - Host: cli.mediaConn.Hosts[0].Hostname, + Host: mediaConn.Hosts[0].Hostname, Path: fmt.Sprintf("/mms/%s/%s", mmsType, token), RawQuery: q.Encode(), } |