mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-30 14:42:00 -08:00
c4157a4d5b
* Update dependencies * Fix whatsmeow API changes
20 lines
592 B
Go
20 lines
592 B
Go
package waMsgTransport
|
|
|
|
import (
|
|
"go.mau.fi/whatsmeow/proto/armadilloutil"
|
|
"go.mau.fi/whatsmeow/proto/waMsgApplication"
|
|
)
|
|
|
|
const (
|
|
MessageApplicationVersion = 2
|
|
)
|
|
|
|
func (msg *MessageTransport_Payload) Decode() (*waMsgApplication.MessageApplication, error) {
|
|
return armadilloutil.Unmarshal(&waMsgApplication.MessageApplication{}, msg.GetApplicationPayload(), MessageApplicationVersion)
|
|
}
|
|
|
|
func (msg *MessageTransport_Payload) Set(payload *waMsgApplication.MessageApplication) (err error) {
|
|
msg.ApplicationPayload, err = armadilloutil.Marshal(payload, MessageApplicationVersion)
|
|
return
|
|
}
|