refactor invitation
This commit is contained in:
22
client/invitation/messages/step2.go
Normal file
22
client/invitation/messages/step2.go
Normal file
@@ -0,0 +1,22 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user