2024-05-23 14:44:31 -07:00
|
|
|
package waMsgTransport
|
|
|
|
|
|
|
|
import (
|
2024-08-27 10:04:05 -07:00
|
|
|
"go.mau.fi/whatsmeow/proto/armadilloutil"
|
|
|
|
"go.mau.fi/whatsmeow/proto/waMsgApplication"
|
2024-05-23 14:44:31 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|