gmessages/libgm/payload/refreshPhoneRelay.go
2023-07-15 20:47:56 +03:00

24 lines
613 B
Go

package payload
import (
"google.golang.org/protobuf/proto"
"go.mau.fi/mautrix-gmessages/libgm/binary"
"go.mau.fi/mautrix-gmessages/libgm/util"
)
func RefreshPhoneRelay(rpcKey []byte) ([]byte, *binary.AuthenticationContainer, error) {
payload := &binary.AuthenticationContainer{
AuthMessage: &binary.AuthenticationMessage{
RequestID: util.RandomUUIDv4(),
Network: Network,
TachyonAuthToken: rpcKey,
ConfigVersion: ConfigMessage,
},
}
encodedPayload, err2 := proto.Marshal(payload)
if err2 != nil {
return nil, payload, err2
}
return encodedPayload, payload, nil
}