matterbridge/vendor/go.mau.fi/whatsmeow/binary/armadillo/waMsgTransport/extra.go

20 lines
614 B
Go
Raw Normal View History

package waMsgTransport
import (
"go.mau.fi/whatsmeow/binary/armadillo/armadilloutil"
"go.mau.fi/whatsmeow/binary/armadillo/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
}