answer invitation bugfix
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
ycc
2024-01-03 23:11:23 +01:00
parent cbedad7178
commit 379b40b2fb
2 changed files with 45 additions and 9 deletions

View File

@ -84,7 +84,7 @@ func (id *Identity) CheckInvitation(ReceivedContact *meowlib.ContactCard) (isAns
func (id *Identity) AnswerInvitation(MyName string, ContactName string, MessageServerIdxs []int, ReceivedContact *meowlib.ContactCard) *Peer {
var peer Peer
var myContactCard meowlib.ContactCard
//var myContactCard meowlib.ContactCard
peer.MyIdentity = meowlib.NewKeyPair()
peer.MyEncryptionKp = meowlib.NewKeyPair()
peer.MyLookupKp = meowlib.NewKeyPair()
@ -96,14 +96,14 @@ func (id *Identity) AnswerInvitation(MyName string, ContactName string, MessageS
peer.Contact = *ReceivedContact
for _, i := range MessageServerIdxs {
srv := id.MessageServers.Servers[i].ServerData
myContactCard.PullServers = append(myContactCard.PullServers, &srv)
peer.MyContact.PullServers = append(peer.MyContact.PullServers, &srv)
}
myContactCard.Name = MyName
myContactCard.ContactPublicKey = peer.MyIdentity.Public
myContactCard.EncryptionPublicKey = peer.MyEncryptionKp.Public
myContactCard.LookupPublicKey = peer.MyLookupKp.Public
myContactCard.InvitationId = ReceivedContact.InvitationId
peer.MyContact.Name = MyName
peer.MyContact.ContactPublicKey = peer.MyIdentity.Public
peer.MyContact.EncryptionPublicKey = peer.MyEncryptionKp.Public
peer.MyContact.LookupPublicKey = peer.MyLookupKp.Public
peer.MyContact.InvitationId = ReceivedContact.InvitationId
peer.InvitationId = ReceivedContact.InvitationId
id.Peers = append(id.Peers, peer)
return &peer