diff options
author | Wim <wim@42.be> | 2020-08-24 23:35:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-24 23:35:08 +0200 |
commit | 2f506425c25504662f50f49e742529195d63ff27 (patch) | |
tree | 47170c6086cee16549a695329a478fd49174c299 /vendor/github.com/Rhymen/go-whatsapp/media.go | |
parent | e8167ee3d73c47353eea1b0bd7062bd2fc3fc127 (diff) | |
download | matterbridge-msglm-2f506425c25504662f50f49e742529195d63ff27.tar.gz matterbridge-msglm-2f506425c25504662f50f49e742529195d63ff27.tar.bz2 matterbridge-msglm-2f506425c25504662f50f49e742529195d63ff27.zip |
Update whatsapp vendor and fix a panic (#1209)
* Fix another whatsapp panic
* Update whatsapp vendor
Diffstat (limited to 'vendor/github.com/Rhymen/go-whatsapp/media.go')
-rw-r--r-- | vendor/github.com/Rhymen/go-whatsapp/media.go | 23 |
1 files changed, 13 insertions, 10 deletions
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) |