From 3a7664d404bca40cb3234924fa969c0ae133d085 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sat, 16 Jul 2022 09:49:54 -0700 Subject: fixed replies to post not showing up when following other boards added content length changes to alter database --- activitypub/object.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'activitypub') diff --git a/activitypub/object.go b/activitypub/object.go index f01d97d..5b78689 100644 --- a/activitypub/object.go +++ b/activitypub/object.go @@ -1277,7 +1277,7 @@ func (obj ObjectBase) WriteReply() error { } if update { - if err := e.WriteUpdate(); err != nil { + if err := e.WriteUpdate(obj.Published); err != nil { return util.MakeError(err, "WriteReply") } } @@ -1321,21 +1321,21 @@ func (obj ObjectBase) WriteCache() (ObjectBase, error) { if obj.Replies.OrderedItems != nil { for _, e := range obj.Replies.OrderedItems { - e._WriteCache() + e.WriteCache() } } return obj, nil } -func (obj ObjectBase) WriteUpdate() error { +func (obj ObjectBase) WriteUpdate(updated time.Time) error { query := `update activitystream set updated=$1 where id=$2` - if _, err := config.DB.Exec(query, time.Now().UTC().Format(time.RFC3339), obj.Id); err != nil { + if _, err := config.DB.Exec(query, updated, obj.Id); err != nil { return util.MakeError(err, "WriteUpdate") } query = `update cacheactivitystream set updated=$1 where id=$2` - _, err := config.DB.Exec(query, time.Now().UTC().Format(time.RFC3339), obj.Id) + _, err := config.DB.Exec(query, updated, obj.Id) return util.MakeError(err, "WriteUpdate") } -- cgit v1.2.3