review3 renames
This commit is contained in:
@ -12,8 +12,7 @@ const key = "3pw0c8#6ZG8{75b5;3?fe80$2"
|
||||
|
||||
type Identity struct {
|
||||
Nickname string `json:"nickname,omitempty"`
|
||||
PublicKey string `json:"public_key,omitempty"`
|
||||
PrivateKey string `json:"private_key,omitempty"`
|
||||
RootKp meowlib.KeyPair `json:"id_kp,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
Peers PeerList `json:"peers,omitempty"`
|
||||
KnownServers InternalServerList `json:"known_servers,omitempty"`
|
||||
@ -23,24 +22,22 @@ type Identity struct {
|
||||
func CreateIdentity(nickname string) *Identity {
|
||||
var id Identity
|
||||
id.Nickname = nickname
|
||||
kp := meowlib.NewKeyPair()
|
||||
id.PublicKey = kp.Public
|
||||
id.PrivateKey = kp.Private
|
||||
id.RootKp = meowlib.NewKeyPair()
|
||||
return &id
|
||||
}
|
||||
|
||||
func (id *Identity) InvitePeer(myName string, contactName string, messageServerIdxs []int) (*Peer, *meowlib.ContactCard) {
|
||||
func (id *Identity) InvitePeer(MyName string, ContactName string, MessageServerIdxs []int) (*Peer, *meowlib.ContactCard) {
|
||||
var peer Peer
|
||||
var myContactCard meowlib.ContactCard
|
||||
peer.Me = meowlib.NewKeyPair()
|
||||
peer.EncryptionKp = meowlib.NewKeyPair()
|
||||
peer.LookupKp = meowlib.NewKeyPair()
|
||||
peer.Name = contactName
|
||||
for _, i := range messageServerIdxs {
|
||||
peer.Name = ContactName
|
||||
for _, i := range MessageServerIdxs {
|
||||
srv := id.MessageServers.Servers[i].ServerData
|
||||
myContactCard.PullServers = append(myContactCard.PullServers, &srv)
|
||||
}
|
||||
myContactCard.Name = myName
|
||||
myContactCard.Name = MyName
|
||||
myContactCard.ContactPublicKey = peer.Me.Public
|
||||
myContactCard.EncryptionPublicKey = peer.EncryptionKp.Public
|
||||
myContactCard.LookupPublicKey = peer.LookupKp.Public
|
||||
@ -50,8 +47,8 @@ func (id *Identity) InvitePeer(myName string, contactName string, messageServerI
|
||||
return &id.Peers[len(id.Peers)-1], &myContactCard
|
||||
}
|
||||
|
||||
func (*Identity) FinalizeInvitation(peer *Peer, receivedContact *meowlib.ContactCard) {
|
||||
peer.Contact = *receivedContact
|
||||
func (*Identity) FinalizeInvitation(peer *Peer, ReceivedContact *meowlib.ContactCard) {
|
||||
peer.Contact = *ReceivedContact
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user