23 lines
843 B
Go
23 lines
843 B
Go
package messages
|
|
|
|
import (
|
|
"forge.redroom.link/yves/meowlib"
|
|
"forge.redroom.link/yves/meowlib/client"
|
|
)
|
|
|
|
// Step1InitiatorCreatesInviteeAndTempKey creates a minimal pending peer and a temporary
|
|
// keypair, and returns the InvitationInitPayload to be transmitted to the invitee
|
|
// via any transport (file, QR, server…).
|
|
func Step1InitiatorCreatesInviteeAndTempKey(contactName string, myNickname string, invitationMessage string, serverUids []string) (*meowlib.InvitationInitPayload, *client.Peer, error) {
|
|
mynick := myNickname
|
|
if mynick == "" {
|
|
mynick = client.GetConfig().GetIdentity().Nickname
|
|
}
|
|
payload, peer, err := client.GetConfig().GetIdentity().InvitationStep1(mynick, contactName, serverUids, invitationMessage)
|
|
if err != nil {
|
|
return nil, nil, err
|
|
}
|
|
client.GetConfig().GetIdentity().Save()
|
|
return payload, peer, nil
|
|
}
|