all repos — honk @ 785d9cec00c28561f6636f17f194b7e29584e1bf

my fork of honk

rework xonk saving to avoid crawling threads we won't ever save
Ted Unangst tedu@tedunangst.com
Mon, 29 Apr 2019 14:06:34 -0400
commit

785d9cec00c28561f6636f17f194b7e29584e1bf

parent

e20d0c56ad9715a3f79ac0152efd82d13c8cbab6

2 files changed, 12 insertions(+), 11 deletions(-)

jump to
M activity.goactivity.go

@@ -240,9 +240,6 @@ return &donk

} func needxonk(user *WhatAbout, x *Honk) bool { - if x == nil { - return false - } if x.What == "eradicate" { return true }

@@ -386,7 +383,7 @@ }

for _, item := range items { xonk := xonkxonk(user, item) - if needxonk(user, xonk) { + if xonk != nil { savexonk(user, xonk) } }

@@ -442,8 +439,7 @@ return

} depth++ xonk := xonkxonkfn(obj) - if needxonk(user, xonk) { - xonk.UserID = user.ID + if xonk != nil { savexonk(user, xonk) } depth--

@@ -516,9 +512,6 @@ convoy, _ = jsongetstring(obj, "conversation")

} if what == "honk" && rid != "" { what = "tonk" - if needxonkid(user, rid) { - saveoneup(rid) - } } } if ot == "Tombstone" {

@@ -581,7 +574,15 @@ xonk.Noise = content

xonk.Audience = audience xonk.Convoy = convoy - return &xonk + if needxonk(user, &xonk) { + if what == "tonk" { + if needxonkid(user, rid) { + saveoneup(rid) + } + } + return &xonk + } + return nil } return xonkxonkfn(item)
M honk.gohonk.go

@@ -372,7 +372,7 @@ }

} default: xonk := xonkxonk(user, j) - if needxonk(user, xonk) { + if xonk != nil { savexonk(user, xonk) } }