28 lines
523 B
Go
28 lines
523 B
Go
|
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
|
||
|
}
|