mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-27 21:22:03 -08:00
2f33fe86f5
* Update dependencies and build to go1.22 * Fix api changes wrt to dependencies * Update golangci config
20 lines
614 B
Go
20 lines
614 B
Go
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
|
|
}
|