summaryrefslogtreecommitdiffstats
path: root/vendor/go.mau.fi/whatsmeow/upload.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/go.mau.fi/whatsmeow/upload.go')
-rw-r--r--vendor/go.mau.fi/whatsmeow/upload.go7
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(),
}