From 472122640204af8fce3fb0cdd0b6fd271b533469 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Wed, 13 May 2020 14:36:16 -0400 Subject: [PATCH] redo create ingestion to follow normal pipeline (again?) --- activity.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/activity.go b/activity.go index 4992abd..eab27bd 100644 --- a/activity.go +++ b/activity.go @@ -462,7 +462,7 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk { } xonkxonkfn = func(item junk.Junk, origin string) *Honk { - // id, _ := item.GetString( "id") + id, _ := item.GetString("id") what, _ := item.GetString("type") dt, ok := item.GetString("published") if !ok { @@ -529,19 +529,20 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk { if !ok { xid, _ = item.GetString("object") log.Printf("getting created honk: %s", xid) + if originate(xid) != origin { + log.Printf("out of bounds %s not from %s", xid, origin) + return nil + } obj, err = GetJunkHardMode(xid) if err != nil { log.Printf("error getting creation: %s", err) } } - what = "honk" - if obj != nil { - t, _ := obj.GetString("type") - switch t { - case "Event": - what = "event" - } + if obj == nil { + log.Printf("no object for creation %s", id) + return nil } + return xonkxonkfn(obj, origin) case "Read": xid, ok = item.GetString("object") if ok { @@ -610,7 +611,7 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk { return nil } if originate(xid) != origin { - log.Printf("original sin: %s <> %s", xid, origin) + log.Printf("original sin: %s not from %s", xid, origin) item.Write(os.Stdout) return nil }