2023-06-30 09:54:08 +00:00
|
|
|
package payload
|
|
|
|
|
|
|
|
import (
|
2023-07-15 17:43:28 +00:00
|
|
|
"google.golang.org/protobuf/proto"
|
|
|
|
|
2023-06-30 09:54:08 +00:00
|
|
|
"go.mau.fi/mautrix-gmessages/libgm/binary"
|
|
|
|
"go.mau.fi/mautrix-gmessages/libgm/util"
|
|
|
|
)
|
|
|
|
|
2023-07-09 11:16:52 +00:00
|
|
|
func RefreshPhoneRelay(rpcKey []byte) ([]byte, *binary.AuthenticationContainer, error) {
|
|
|
|
payload := &binary.AuthenticationContainer{
|
|
|
|
AuthMessage: &binary.AuthenticationMessage{
|
|
|
|
RequestID: util.RandomUUIDv4(),
|
|
|
|
Network: Network,
|
|
|
|
TachyonAuthToken: rpcKey,
|
|
|
|
ConfigVersion: ConfigMessage,
|
2023-06-30 09:54:08 +00:00
|
|
|
},
|
|
|
|
}
|
2023-07-15 17:43:28 +00:00
|
|
|
encodedPayload, err2 := proto.Marshal(payload)
|
2023-06-30 09:54:08 +00:00
|
|
|
if err2 != nil {
|
|
|
|
return nil, payload, err2
|
|
|
|
}
|
|
|
|
return encodedPayload, payload, nil
|
|
|
|
}
|