summaryrefslogtreecommitdiff
path: root/internal/typeutils/astointernal.go
diff options
context:
space:
mode:
authorLibravatar Daenney <daenney@users.noreply.github.com>2023-08-07 19:38:11 +0200
committerLibravatar GitHub <noreply@github.com>2023-08-07 18:38:11 +0100
commitbe3718f6e4c7bb229f9eb78b44c52d14399977cc (patch)
treea0efc132fbfb806227cc4b9af8bac9f5a5775c1c /internal/typeutils/astointernal.go
parent[chore]: Bump github.com/tdewolff/minify/v2 from 2.12.7 to 2.12.8 (#2073) (diff)
downloadgotosocial-be3718f6e4c7bb229f9eb78b44c52d14399977cc.tar.xz
[chore] Use generic pointer function (#2080)
This replaces the different $TypePtr functions with a generic implementation.
Diffstat (limited to 'internal/typeutils/astointernal.go')
-rw-r--r--internal/typeutils/astointernal.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/typeutils/astointernal.go b/internal/typeutils/astointernal.go
index 9b2552131..ea77bb65c 100644
--- a/internal/typeutils/astointernal.go
+++ b/internal/typeutils/astointernal.go
@@ -31,6 +31,7 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/log"
"github.com/superseriousbusiness/gotosocial/internal/uris"
+ "github.com/superseriousbusiness/gotosocial/internal/util"
)
func (c *converter) ASRepresentationToAccount(ctx context.Context, accountable ap.Accountable, accountDomain string) (*gtsmodel.Account, error) {
@@ -396,11 +397,10 @@ func (c *converter) ASStatusToStatus(ctx context.Context, statusable ap.Statusab
// TODO: a lot of work to be done here -- a new type
// needs to be created for this in go-fed/activity.
// Until this is implemented, assume all true.
- var trueBool = func() *bool { b := true; return &b }
- status.Federated = trueBool()
- status.Boostable = trueBool()
- status.Replyable = trueBool()
- status.Likeable = trueBool()
+ status.Federated = util.Ptr(true)
+ status.Boostable = util.Ptr(true)
+ status.Replyable = util.Ptr(true)
+ status.Likeable = util.Ptr(true)
// status.Sensitive
status.Sensitive = func() *bool {