cleaner invitation step messages
This commit is contained in:
@@ -1,22 +1,23 @@
|
||||
package messages
|
||||
|
||||
import (
|
||||
"forge.redroom.link/yves/meowlib"
|
||||
"forge.redroom.link/yves/meowlib/client"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// 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) {
|
||||
// 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, peer, err := client.GetConfig().GetIdentity().InvitationStep1(mynick, contactName, serverUids, invitationMessage)
|
||||
payload, _, err := client.GetConfig().GetIdentity().InvitationStep1(mynick, contactName, serverUids, invitationMessage)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
return nil, err
|
||||
}
|
||||
client.GetConfig().GetIdentity().Save()
|
||||
return payload, peer, nil
|
||||
return proto.Marshal(payload)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user