Skip to content

Commit

Permalink
Fixes a dumb error in e56da9e. That's what I get for not updating the…
Browse files Browse the repository at this point in the history
… tests properly.
  • Loading branch information
burdges committed Dec 9, 2014
1 parent e56da9e commit 7c1dcd5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
5 changes: 2 additions & 3 deletions client/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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}
Expand Down
14 changes: 7 additions & 7 deletions client/introduce.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down

0 comments on commit 7c1dcd5

Please sign in to comment.