diff --git a/client/gui.go b/client/gui.go index a275adc..efcbafa 100644 --- a/client/gui.go +++ b/client/gui.go @@ -2505,9 +2505,7 @@ func (c *guiClient) newContactUI(contact *Contact) interface{} { existing := contact != nil if existing { name = contact.name - } else { - c.initSocialGraphRecords(contact) - } + } grid := Grid{ widgetBase: widgetBase{name: "grid", margin: 5}, @@ -2641,6 +2639,7 @@ Manual keying (not generally recommended) involves exchanging key material with isPending: true, id: c.randId(), } + c.initSocialGraphRecords(contact) c.gui.Actions() <- SetText{name: "error1", text: ""} c.gui.Actions() <- Sensitive{name: "name", sensitive: false} diff --git a/client/introduce.go b/client/introduce.go index 7b276c5..746a400 100644 --- a/client/introduce.go +++ b/client/introduce.go @@ -50,13 +50,13 @@ func (contact *Contact) keepSocialGraphRecords() bool { func (c *client) initSocialGraphRecords(contact *Contact) { // If all existing contacts have the Dark Web of Trust disabled then // new contacts should start with the Dark Web of Trust disabled too. - if contact.introducedBy == 0 && len(c.contacts) > 0 { - contact.introducedBy = disableDarkWebOfTrust - for _,cnt := range c.contacts { - if cnt.introducedBy != disableDarkWebOfTrust { - contact.introducedBy = 0 - break - } + if contact.introducedBy != 0 { return } + if c.contacts == nil && len(c.contacts) == 0 { return } + contact.introducedBy = disableDarkWebOfTrust + for _,cnt := range c.contacts { + if cnt.introducedBy != disableDarkWebOfTrust { + contact.introducedBy = 0 + break } } }