This commit is contained in:
@ -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")
|
||||
|
Reference in New Issue
Block a user