forked from cwtch.im/cwtch
1
0
Fork 0

Fix AddContact

This commit is contained in:
Sarah Jamie Lewis 2019-02-04 11:39:58 -08:00
parent ffa2144b9f
commit eb2a770085
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,
}))
}