This commit is contained in:
@@ -6,17 +6,28 @@ import (
|
||||
)
|
||||
|
||||
// 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) {
|
||||
// from an InvitationInitPayload, then builds the invitee's ContactCard and returns it
|
||||
// as a PackedUserMessage asymmetrically encrypted with the initiator's temporary public
|
||||
// key. The packed message is ready to be transmitted to the initiator via any transport
|
||||
// (file, QR, server…); Step3InitiatorFinalizesInviteeAndCreatesContactCard on the
|
||||
// initiator side will decrypt and process it.
|
||||
func Step2InviteeCreatesInitiatorAndEncryptedContactCard(payload *meowlib.InvitationInitPayload, nickname string, myNickname string, serverUids []string) (*meowlib.PackedUserMessage, *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
|
||||
return nil, nil, err
|
||||
}
|
||||
usermsg, err := peer.BuildInvitationStep2Message(peer.GetMyContact())
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
packed, err := peer.ProcessOutboundUserMessage(usermsg)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
client.GetConfig().GetIdentity().Save()
|
||||
return peer, nil
|
||||
return packed, peer, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user