peers separate
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
ycc
2024-05-28 16:47:04 +02:00
parent c1883f1524
commit e674a0cb33
11 changed files with 164 additions and 79 deletions

View File

@ -91,14 +91,16 @@ func InvitationAnswerFile(invitationFile string, nickname string, myNickname str
func InvitationAnswerMessage(invitationId string, invitationServerUid string, timeout int) ([]byte, string, error) {
// find the peer with that invitation id
var peer *client.Peer
/*var peer *client.Peer
for i := len(client.GetConfig().GetIdentity().Peers) - 1; i >= 0; i-- { //! to allow self invitation : testing only, findinc the received peer before myself
// for i := 0; i < len(client.GetConfig().GetIdentity().Peers); i++ {
if client.GetConfig().GetIdentity().Peers[i].InvitationId == invitationId {
peer = client.GetConfig().GetIdentity().Peers[i]
break
}
}
}*/
peer := client.GetConfig().GetIdentity().Peers.GetFromInvitationId(invitationId)
if peer == nil {
// declare a custom go error for no peer found
return nil, "InvitationAnswerMessage: loop for peer", errors.New("no peer with that invitation id")