gmessages/libgm/payload/refreshPhoneRelay.go
Tulir Asokan 1615e146b6 Update library
Co-authored-by: zero <108243503+0xzer@users.noreply.github.com>
2023-07-09 14:49:55 +03:00

22 lines
588 B
Go

package payload
import (
"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 := binary.EncodeProtoMessage(payload)
if err2 != nil {
return nil, payload, err2
}
return encodedPayload, payload, nil
}