Merge branch 'addcontactbugfix' of cwtch.im/cwtch into master

This commit is contained in:
Dan Ballard 2019-02-04 19:57:04 +00:00 committed by Gogs
commit b845673d10
1 changed files with 2 additions and 0 deletions

View File

@ -187,7 +187,9 @@ func (cp *cwtchPeer) AddContact(nick, onion string, publickey []byte, trusted bo
pp := &model.PublicProfile{Name: nick, Ed25519PublicKey: publickey, Trusted: trusted, Blocked: false, Onion: onion, Attributes: map[string]string{"name": nick}}
cp.GetProfile().Contacts[onion] = pp
cp.Profile.AddContact(onion, pp)
pd, _ := json.Marshal(pp)
cp.eventBus.Publish(event.NewEvent(event.PeerCreated, map[event.Field]string{
event.Data: string(pd),
event.RemotePeer: onion,
}))
}