24 lines
905 B
Go
24 lines
905 B
Go
package messages
|
|
|
|
import (
|
|
"forge.redroom.link/yves/meowlib/client"
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
// Step1InitiatorCreatesInviteeAndTempKey creates a minimal pending peer and a temporary
|
|
// keypair, and returns the serialized InvitationInitPayload bytes to be transmitted to
|
|
// the invitee via any transport (file, QR, server…). The peer is already persisted by
|
|
// InvitationStep1 so no peer reference is returned.
|
|
func Step1InitiatorCreatesInviteeAndTempKey(contactName string, myNickname string, invitationMessage string, serverUids []string) ([]byte, error) {
|
|
mynick := myNickname
|
|
if mynick == "" {
|
|
mynick = client.GetConfig().GetIdentity().Nickname
|
|
}
|
|
payload, _, err := client.GetConfig().GetIdentity().InvitationStep1(mynick, contactName, serverUids, invitationMessage)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
client.GetConfig().GetIdentity().Save()
|
|
return proto.Marshal(payload)
|
|
}
|