From 24183ff581aa2cffd38dcffa4bad680327a90a7a Mon Sep 17 00:00:00 2001 From: ycc Date: Sat, 10 Feb 2024 15:05:02 +0100 Subject: [PATCH] Remove MyContact contactcard from peer --- client/identity.go | 33 +++++++++++++-------------------- client/peer.go | 9 ++++----- 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/client/identity.go b/client/identity.go index dfe7abf..0c2e5cd 100644 --- a/client/identity.go +++ b/client/identity.go @@ -64,17 +64,13 @@ func (id *Identity) InvitePeer(MyName string, ContactName string, MessageServerU srv := id.MessageServers.Servers[i].GetServerCard() peer.MyContact.PullServers = append(peer.MyContact.PullServers, srv) }*/ - pullServers, err := id.MessageServers.LoadServerCardsFromUids(MessageServerUids) - if err != nil { - return nil, err - } - peer.MyContact.PullServers = pullServers - peer.MyContact.Name = MyName - peer.MyContact.ContactPublicKey = peer.MyIdentity.Public - peer.MyContact.EncryptionPublicKey = peer.MyEncryptionKp.Public - peer.MyContact.LookupPublicKey = peer.MyLookupKp.Public - peer.MyContact.InvitationId = peer.InvitationId - peer.MyContact.InvitationMessage = InvitationMessage + /* pullServers, err := id.MessageServers.LoadServerCardsFromUids(MessageServerUids) + if err != nil { + return nil, err + }*/ + peer.MyPullServers = MessageServerUids + peer.MyName = MyName + peer.InvitationMessage = InvitationMessage id.Peers = append(id.Peers, peer) return &peer, nil @@ -107,15 +103,12 @@ func (id *Identity) AnswerInvitation(MyName string, ContactName string, MessageS srv := id.MessageServers.Servers[i].GetServerCard() peer.MyContact.PullServers = append(peer.MyContact.PullServers, srv) }*/ - srvCards, err := GetConfig().GetIdentity().MessageServers.LoadServerCardsFromUids(MessageServerIdxs) - if err != nil { - peer.MyContact.PullServers = srvCards - } - peer.MyContact.Name = MyName - peer.MyContact.ContactPublicKey = peer.MyIdentity.Public - peer.MyContact.EncryptionPublicKey = peer.MyEncryptionKp.Public - peer.MyContact.LookupPublicKey = peer.MyLookupKp.Public - peer.MyContact.InvitationId = ReceivedContact.InvitationId + /* srvCards, err := GetConfig().GetIdentity().MessageServers.LoadServerCardsFromUids(MessageServerIdxs) + if err != nil { + peer.MyContact.PullServers = srvCards + }*/ + peer.MyPullServers = MessageServerIdxs + peer.MyName = MyName peer.InvitationId = ReceivedContact.InvitationId id.Peers = append(id.Peers, peer) diff --git a/client/peer.go b/client/peer.go index 201c9f2..76e4c1d 100644 --- a/client/peer.go +++ b/client/peer.go @@ -21,11 +21,10 @@ type Peer struct { MyAvatar string `json:"my_avatar,omitempty"` // Conversation []InternalMessage `json:"conversation,omitempty"` // My own keys for that peer - MyIdentity meowlib.KeyPair `json:"my_identity,omitempty"` - MyEncryptionKp meowlib.KeyPair `json:"my_encryption_kp,omitempty"` - MyLookupKp meowlib.KeyPair `json:"my_lookup_kp,omitempty"` - MyPullServers []string `json:"my_pull_servers,omitempty"` - MyContact meowlib.ContactCard `json:"my_contact,omitempty"` // todo : remove + MyIdentity meowlib.KeyPair `json:"my_identity,omitempty"` + MyEncryptionKp meowlib.KeyPair `json:"my_encryption_kp,omitempty"` + MyLookupKp meowlib.KeyPair `json:"my_lookup_kp,omitempty"` + MyPullServers []string `json:"my_pull_servers,omitempty"` // Peer keys and infos Contact meowlib.ContactCard `json:"contact,omitempty"` // todo : remove ContactPublicKey string `json:"contact_public_key,omitempty"`