From c6716e030c02f316b887c1d3ee4b443aa3ab6afd Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 1 Apr 2022 00:23:19 +0200 Subject: Update dependencies (#1784) --- vendor/go.mau.fi/whatsmeow/upload.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'vendor/go.mau.fi/whatsmeow/upload.go') 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(), } -- cgit v1.2.3