From 273267343ab8ba545f18ba502133dd9253f45312 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Mon, 2 Oct 2023 21:35:23 -0400 Subject: [PATCH] Ensure Updated property can be omitted Now, the web-core pkg uses a pointer instead of a var, so we don't send a zero time.Time value out via ActivityPub. --- activitypub.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/activitypub.go b/activitypub.go index c9dd9c8..01aeadd 100644 --- a/activitypub.go +++ b/activitypub.go @@ -718,7 +718,7 @@ func federatePost(app *App, p *PublicPost, collID int64, isUpdate bool) error { // create a new "Create" activity // with our article as object if isUpdate { - na.Updated = p.Updated + na.Updated = &p.Updated activity = activitystreams.NewUpdateActivity(na) } else { activity = activitystreams.NewCreateActivity(na) diff --git a/go.mod b/go.mod index d657f66..979bae1 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( github.com/writeas/monday v1.3.0 github.com/writeas/saturday v1.7.2-0.20200427193424-392b95a03320 github.com/writeas/slug v1.2.0 - github.com/writeas/web-core v1.6.1-0.20231002232751-adbbafe3ee0c + github.com/writeas/web-core v1.6.1-0.20231003013047-d81124d45431 github.com/writefreely/go-gopher v0.0.0-20220429181814-40127126f83b github.com/writefreely/go-nodeinfo v1.2.0 golang.org/x/crypto v0.13.0 diff --git a/go.sum b/go.sum index 48f67cc..3dbbf9f 100644 --- a/go.sum +++ b/go.sum @@ -143,8 +143,8 @@ github.com/writeas/saturday v1.7.2-0.20200427193424-392b95a03320 h1:PozPZ29CQ/xt github.com/writeas/saturday v1.7.2-0.20200427193424-392b95a03320/go.mod h1:ETE1EK6ogxptJpAgUbcJD0prAtX48bSloie80+tvnzQ= github.com/writeas/slug v1.2.0 h1:EMQ+cwLiOcA6EtFwUgyw3Ge18x9uflUnOnR6bp/J+/g= github.com/writeas/slug v1.2.0/go.mod h1:RE8shOqQP3YhsfsQe0L3RnuejfQ4Mk+JjY5YJQFubfQ= -github.com/writeas/web-core v1.6.1-0.20231002232751-adbbafe3ee0c h1:OcubGLNP26NPbe7s8ppUi8pl1IPKMHZ7Wu+jjxDATBg= -github.com/writeas/web-core v1.6.1-0.20231002232751-adbbafe3ee0c/go.mod h1:7+idL4Y4woF7MnUfNX2mvkaQ8nLIJXths2y5iYPtA3k= +github.com/writeas/web-core v1.6.1-0.20231003013047-d81124d45431 h1:ruqL2u87k504PXkR/fC4DcfZyyHmCindlpjOQKmyOsY= +github.com/writeas/web-core v1.6.1-0.20231003013047-d81124d45431/go.mod h1:7+idL4Y4woF7MnUfNX2mvkaQ8nLIJXths2y5iYPtA3k= github.com/writefreely/go-gopher v0.0.0-20220429181814-40127126f83b h1:h3NzB8OZ50NNi5k9yrFeyFszt3LyqyVK4+xUHFYY8B0= github.com/writefreely/go-gopher v0.0.0-20220429181814-40127126f83b/go.mod h1:T2UVVzt+R5KSSZe2xRSytnwc2M9AoDegi7foeIsik+M= github.com/writefreely/go-nodeinfo v1.2.0 h1:La+YbTCvmpTwFhBSlebWDDL81N88Qf/SCAvRLR7F8ss=