summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/Rhymen/go-whatsapp/handler.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-10-27 01:45:57 +0200
committerGitHub <noreply@github.com>2019-10-27 01:45:57 +0200
commit0bc159341dbb4aece685ce373e9bc0b6b32984e7 (patch)
treeed67d8e03541b2cb61ab161771f1c6e41070d372 /vendor/github.com/Rhymen/go-whatsapp/handler.go
parent45bf1fd63a62b46fc80fe5143e667f6779705a0d (diff)
downloadmatterbridge-msglm-0bc159341dbb4aece685ce373e9bc0b6b32984e7.tar.gz
matterbridge-msglm-0bc159341dbb4aece685ce373e9bc0b6b32984e7.tar.bz2
matterbridge-msglm-0bc159341dbb4aece685ce373e9bc0b6b32984e7.zip
Update vendor (#932)
* Update vendor * Fix godiscord api change
Diffstat (limited to 'vendor/github.com/Rhymen/go-whatsapp/handler.go')
-rw-r--r--vendor/github.com/Rhymen/go-whatsapp/handler.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/github.com/Rhymen/go-whatsapp/handler.go b/vendor/github.com/Rhymen/go-whatsapp/handler.go
index 8d4b6bee..a70d15bf 100644
--- a/vendor/github.com/Rhymen/go-whatsapp/handler.go
+++ b/vendor/github.com/Rhymen/go-whatsapp/handler.go
@@ -82,6 +82,14 @@ type LocationMessageHandler interface {
}
/*
+The StickerMessageHandler interface needs to be implemented to receive location messages dispatched by the dispatcher.
+*/
+type StickerMessageHandler interface {
+ Handler
+ HandleStickerMessage(message StickerMessage)
+}
+
+/*
The JsonMessageHandler interface needs to be implemented to receive json messages dispatched by the dispatcher.
These json messages contain status updates of every kind sent by WhatsAppWeb servers. WhatsAppWeb uses these messages
to built a Store, which is used to save these "secondary" information. These messages may contain
@@ -247,6 +255,18 @@ func (wac *Conn) handleWithCustomHandlers(message interface{}, handlers []Handle
}
}
}
+
+ case StickerMessage:
+ for _, h := range handlers {
+ if x, ok := h.(StickerMessageHandler); ok {
+ if wac.shouldCallSynchronously(h) {
+ x.HandleStickerMessage(m)
+ } else {
+ go x.HandleStickerMessage(m)
+ }
+ }
+ }
+
case *proto.WebMessageInfo:
for _, h := range handlers {
if x, ok := h.(RawMessageHandler); ok {