diff --git a/go/gothings/uistate.go b/go/gothings/uistate.go index 3e00ec52..c870d536 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 d325ab9a..20bf5709 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)