From f5e83b4905c90fdbef1126c4bb9f1e49c9ad3851 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Thu, 10 Oct 2019 19:12:34 -0400 Subject: [PATCH] if update without create, just create --- activity.go | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/activity.go b/activity.go index 65e45bb..e090ab8 100644 --- a/activity.go +++ b/activity.go @@ -827,16 +827,18 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk { prev := getxonk(user.ID, xonk.XID) if prev == nil { log.Printf("didn't find old version for update: %s", xonk.XID) - return nil + isUpdate = false + } else { + prev.Noise = xonk.Noise + prev.Precis = xonk.Precis + prev.Date = xonk.Date + prev.Donks = xonk.Donks + prev.Onts = xonk.Onts + prev.Place = xonk.Place + updatehonk(prev) } - prev.Noise = xonk.Noise - prev.Precis = xonk.Precis - prev.Date = xonk.Date - prev.Donks = xonk.Donks - prev.Onts = xonk.Onts - prev.Place = xonk.Place - updatehonk(prev) - } else if needxonk(user, &xonk) { + } + if !isUpdate && needxonk(user, &xonk) { if rid != "" { if needxonkid(user, rid) { goingup++