mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-09-11 01:52:30 +00:00
Update vendor (#1257)
This commit is contained in:
23
vendor/github.com/Rhymen/go-whatsapp/handler.go
generated
vendored
23
vendor/github.com/Rhymen/go-whatsapp/handler.go
generated
vendored
@@ -141,6 +141,14 @@ type BatteryMessageHandler interface {
|
||||
HandleBatteryMessage(battery BatteryMessage)
|
||||
}
|
||||
|
||||
/**
|
||||
The NewContactHandler interface needs to be implemented to receive the contact's name for the first time.
|
||||
*/
|
||||
type NewContactHandler interface {
|
||||
Handler
|
||||
HandleNewContact(contact Contact)
|
||||
}
|
||||
|
||||
/*
|
||||
AddHandler adds an handler to the list of handler that receive dispatched messages.
|
||||
The provided handler must at least implement the Handler interface. Additionally implemented
|
||||
@@ -304,6 +312,17 @@ func (wac *Conn) handleWithCustomHandlers(message interface{}, handlers []Handle
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case Contact:
|
||||
for _, h := range handlers {
|
||||
if x, ok := h.(NewContactHandler); ok {
|
||||
if wac.shouldCallSynchronously(h) {
|
||||
x.HandleNewContact(m)
|
||||
} else {
|
||||
go x.HandleNewContact(m)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case *proto.WebMessageInfo:
|
||||
for _, h := range handlers {
|
||||
@@ -397,6 +416,10 @@ func (wac *Conn) dispatch(msg interface{}) {
|
||||
wac.handle(v)
|
||||
wac.handle(ParseProtoMessage(v))
|
||||
}
|
||||
|
||||
if v, ok := con[a].(binary.Node); ok {
|
||||
wac.handle(ParseNodeMessage(v))
|
||||
}
|
||||
}
|
||||
} else if con, ok := message.Content.([]binary.Node); ok {
|
||||
for a := range con {
|
||||
|
Reference in New Issue
Block a user