summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/Rhymen/go-whatsapp/contact.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/Rhymen/go-whatsapp/contact.go')
-rw-r--r--vendor/github.com/Rhymen/go-whatsapp/contact.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/vendor/github.com/Rhymen/go-whatsapp/contact.go b/vendor/github.com/Rhymen/go-whatsapp/contact.go
index 9faaf5cc..bcaf8734 100644
--- a/vendor/github.com/Rhymen/go-whatsapp/contact.go
+++ b/vendor/github.com/Rhymen/go-whatsapp/contact.go
@@ -51,6 +51,10 @@ func (wac *Conn) LoadMessagesAfter(jid, messageId string, count int) (*binary.No
return wac.query("message", jid, messageId, "after", "true", "", count, 0)
}
+func (wac *Conn) LoadMediaInfo(jid, messageId, owner string) (*binary.Node, error) {
+ return wac.query("media", jid, messageId, "", owner, "", 0, 0)
+}
+
func (wac *Conn) Presence(jid string, presence Presence) (<-chan string, error) {
ts := time.Now().Unix()
tag := fmt.Sprintf("%d.--%d", ts, wac.msgCount)
@@ -163,7 +167,12 @@ func (wac *Conn) query(t, jid, messageId, kind, owner, search string, count, pag
n.Attributes["page"] = strconv.Itoa(page)
}
- ch, err := wac.writeBinary(n, group, ignore, tag)
+ metric := group
+ if t == "media" {
+ metric = queryMedia
+ }
+
+ ch, err := wac.writeBinary(n, metric, ignore, tag)
if err != nil {
return nil, err
}