2023-06-30 09:54:08 +00:00
|
|
|
package payload
|
|
|
|
|
|
|
|
import (
|
|
|
|
"go.mau.fi/mautrix-gmessages/libgm/binary"
|
|
|
|
"go.mau.fi/mautrix-gmessages/libgm/util"
|
|
|
|
)
|
|
|
|
|
2023-06-30 12:49:32 +00:00
|
|
|
func RefreshPhoneRelay(rpcKey []byte) ([]byte, *binary.Container, error) {
|
2023-06-30 09:54:08 +00:00
|
|
|
payload := &binary.Container{
|
|
|
|
PhoneRelay: &binary.PhoneRelayBody{
|
2023-06-30 13:26:46 +00:00
|
|
|
ID: util.RandomUUIDv4(),
|
2023-06-30 09:54:08 +00:00
|
|
|
Bugle: "Bugle",
|
2023-06-30 12:49:32 +00:00
|
|
|
RpcKey: rpcKey,
|
2023-06-30 09:54:08 +00:00
|
|
|
Date: &binary.Date{
|
|
|
|
Year: 2023,
|
|
|
|
Seq1: 6,
|
2023-07-02 14:19:00 +00:00
|
|
|
Seq2: 22,
|
2023-06-30 09:54:08 +00:00
|
|
|
Seq3: 4,
|
|
|
|
Seq4: 6,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
encodedPayload, err2 := binary.EncodeProtoMessage(payload)
|
|
|
|
if err2 != nil {
|
|
|
|
return nil, payload, err2
|
|
|
|
}
|
|
|
|
return encodedPayload, payload, nil
|
|
|
|
}
|