23 lines
799 B
Go
23 lines
799 B
Go
package messages
|
|
|
|
import (
|
|
"forge.redroom.link/yves/meowlib"
|
|
"forge.redroom.link/yves/meowlib/client"
|
|
)
|
|
|
|
// Step2InviteeCreatesInitiatorAndEncryptedContactCard creates the invitee's peer entry
|
|
// from an InvitationInitPayload and generates the encrypted ContactCard to be sent back
|
|
// to the initiator via any transport.
|
|
func Step2InviteeCreatesInitiatorAndEncryptedContactCard(payload *meowlib.InvitationInitPayload, nickname string, myNickname string, serverUids []string) (*client.Peer, error) {
|
|
mynick := myNickname
|
|
if mynick == "" {
|
|
mynick = client.GetConfig().GetIdentity().Nickname
|
|
}
|
|
peer, err := client.GetConfig().GetIdentity().InvitationStep2(mynick, nickname, serverUids, payload)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
client.GetConfig().GetIdentity().Save()
|
|
return peer, nil
|
|
}
|