From 2f506425c25504662f50f49e742529195d63ff27 Mon Sep 17 00:00:00 2001 From: Wim Date: Mon, 24 Aug 2020 23:35:08 +0200 Subject: Update whatsapp vendor and fix a panic (#1209) * Fix another whatsapp panic * Update whatsapp vendor --- vendor/github.com/Rhymen/go-whatsapp/media.go | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'vendor/github.com/Rhymen/go-whatsapp/media.go') diff --git a/vendor/github.com/Rhymen/go-whatsapp/media.go b/vendor/github.com/Rhymen/go-whatsapp/media.go index 87827d9c..43ff424f 100644 --- a/vendor/github.com/Rhymen/go-whatsapp/media.go +++ b/vendor/github.com/Rhymen/go-whatsapp/media.go @@ -93,18 +93,21 @@ func downloadMedia(url string) (file []byte, mac []byte, err error) { return data[:n-10], data[n-10 : n], nil } -type MediaConn struct { - Status int `json:"status"` - MediaConn struct { - Auth string `json:"auth"` - TTL int `json:"ttl"` - Hosts []struct { - Hostname string `json:"hostname"` - IPs []string `json:"ips"` - } `json:"hosts"` - } `json:"media_conn"` + +type MediaConn struct { + Status int `json:"status"` + MediaConn struct { + Auth string `json:"auth"` + TTL int `json:"ttl"` + Hosts []struct { + Hostname string `json:"hostname"` + IPs []interface{} `json:"ips"` + } `json:"hosts"` + } `json:"media_conn"` } + + func (wac *Conn) queryMediaConn() (hostname, auth string, ttl int, err error) { queryReq := []interface{}{"query", "mediaConn"} ch, err := wac.writeJson(queryReq) -- cgit v1.2.3