This commit is contained in:
@@ -62,29 +62,20 @@ func Step2ReadResponse(invitationData []byte, invitationServerUid string) (*meow
|
||||
return meowlib.NewInvitationInitPayloadFromCompressed(serverMsg.Invitation.Payload)
|
||||
}
|
||||
|
||||
// Step2PostAnswer builds and returns the packed server message that posts the
|
||||
// invitee's ContactCard (encrypted with the initiator's temp key) to the invitation server.
|
||||
func Step2PostAnswer(invitationId string, invitationServerUid string, timeout int) ([]byte, error) {
|
||||
// Step2PostAnswer wraps the invitee's already-built PackedUserMessage into a server
|
||||
// message and posts it to the invitation server. The packed message is produced by
|
||||
// messages.Step2InviteeCreatesInitiatorAndEncryptedContactCard.
|
||||
func Step2PostAnswer(invitationId string, packedMsg *meowlib.PackedUserMessage, invitationServerUid string, timeout int) ([]byte, error) {
|
||||
peer := client.GetConfig().GetIdentity().Peers.GetFromInvitationId(invitationId)
|
||||
if peer == nil {
|
||||
return nil, errors.New("no peer with that invitation id")
|
||||
}
|
||||
|
||||
answermsg, err := peer.BuildInvitationStep2Message(peer.GetMyContact())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
invitationServer, err := client.GetConfig().GetIdentity().MessageServers.LoadServer(invitationServerUid)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
packedMsg, err := peer.ProcessOutboundUserMessage(answermsg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
toServerMessage, err := invitationServer.BuildToServerMessageInvitationAnswer(packedMsg, peer.MyIdentity.Public, invitationId, timeout)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user