From 73eb5a6ef50ad3812102510dd9521909482c42ea Mon Sep 17 00:00:00 2001 From: erinn Date: Sat, 2 Feb 2019 17:19:51 -0800 Subject: [PATCH] save contacts --- go/gothings/uistate.go | 17 +---------------- main.go | 1 - 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/go/gothings/uistate.go b/go/gothings/uistate.go index 3e00ec5..c870d53 100644 --- a/go/gothings/uistate.go +++ b/go/gothings/uistate.go @@ -1,8 +1,6 @@ package gothings import ( - "cwtch.im/cwtch/event" - "cwtch.im/cwtch/model" "cwtch.im/ui/go/constants" "cwtch.im/ui/go/gobjects" "cwtch.im/ui/go/the" @@ -39,20 +37,7 @@ func (this *InterfaceState) AddContact(c *gobjects.Contact) { if the.Peer.GetContact(c.Handle) == nil { decodedPub, _ := base32.StdEncoding.DecodeString(strings.ToUpper(c.Handle)) - - pp := &model.PublicProfile{Name: c.DisplayName, Ed25519PublicKey: decodedPub[:32], Trusted: c.Trusted, Blocked: false, Onion: c.Handle, Attributes: make(map[string]string)} - pp.SetAttribute("name", c.DisplayName) - the.Peer.GetProfile().Contacts[c.Handle] = pp - if c.Trusted { - the.Peer.GetProfile().TrustPeer(c.Handle) - } - - the.CwtchApp.EventBus().Publish(event.NewEvent(event.SetPeerAttribute, map[event.Field]string{ - event.RemotePeer: c.Handle, - event.Key: "name", - event.Data: c.DisplayName, - })) - + the.Peer.AddContact(c.DisplayName, c.Handle, decodedPub, c.Trusted) go the.Peer.PeerWithOnion(c.Handle) } diff --git a/main.go b/main.go index d325ab9..20bf570 100644 --- a/main.go +++ b/main.go @@ -165,7 +165,6 @@ func loadCwtchData(gcd *gothings.GrandCentralDispatcher) { groups := the.Peer.GetGroups() for i := range groups { - log.Infof("adding saved group %v", groups[i]) group := the.Peer.GetGroup(groups[i]) group.NewMessage = make(chan model.Message) the.Peer.JoinServer(group.GroupServer)