fixes step 2
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
yc
2026-04-12 13:38:15 +02:00
parent 793213b3fb
commit 327bd390c4
7 changed files with 186 additions and 111 deletions

View File

@@ -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
}