Change Peers to * Peers in identity to retrieve pointer to the real peer
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
ycc
2024-03-02 10:07:59 +01:00
parent aa63bb745f
commit 3467ea15d9
6 changed files with 26 additions and 26 deletions

View File

@ -4,12 +4,12 @@ import (
"forge.redroom.link/yves/meowlib"
)
type PeerList []Peer
type PeerList []*Peer
func (pl *PeerList) GetFromPublicKey(publickey string) *Peer {
for _, peer := range *pl {
if peer.ContactPublicKey == publickey {
return &peer
return peer
}
}
return nil
@ -18,7 +18,7 @@ func (pl *PeerList) GetFromPublicKey(publickey string) *Peer {
func (pl *PeerList) GetFromMyLookupKey(publickey string) *Peer {
for _, peer := range *pl {
if peer.MyLookupKp.Public == publickey {
return &peer
return peer
}
}
return nil
@ -27,7 +27,7 @@ func (pl *PeerList) GetFromMyLookupKey(publickey string) *Peer {
func (pl *PeerList) GetFromName(name string) *Peer {
for _, peer := range *pl {
if peer.Name == name {
return &peer
return peer
}
}
return nil