meowlib/peer.go

28 lines
523 B
Go
Raw Normal View History

2021-10-18 21:05:44 +02:00
package meow
import "time"
type Peer struct {
Me KeysArray
Name string
Visible bool
Password string
MessageNotification string
PublicKey string
PushServers []Server
OnionMode bool
Convdersation []Message
LastMessage time.Time
}
type PeerList []Peer
func (pl *PeerList) GetFromPublicKey(publickey string) *Peer {
for _, peer := range *pl {
if peer.PublicKey == publickey {
return &peer
}
}
return nil
}