summaryrefslogtreecommitdiff
path: root/internal/typeutils/internaltofrontend.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-12-24 21:16:49 +0000
committerLibravatar GitHub <noreply@github.com>2024-12-24 21:16:49 +0000
commit0784aa3218934dea46c2fa501696e7f32696168b (patch)
treef69af51af9ec809b04d7c09e7b95ee98b0920ee0 /internal/typeutils/internaltofrontend.go
parent[feature] add support for clients editing statuses and fetching status revisi... (diff)
downloadgotosocial-0784aa3218934dea46c2fa501696e7f32696168b.tar.xz
[bugfix] small editing tweaks (#3631)
* ensure edited_at isn't set on boost wrapper statuses * improve handling of remote status updated_at to fix previous cases * formatting * add remote status published / updated field validation checks, handle appropriately in handleStatusEdit() * specifically allowed updated to be equal to published * only check creation date change when an existing status
Diffstat (limited to 'internal/typeutils/internaltofrontend.go')
-rw-r--r--internal/typeutils/internaltofrontend.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/typeutils/internaltofrontend.go b/internal/typeutils/internaltofrontend.go
index 3208fcb51..0d5e15078 100644
--- a/internal/typeutils/internaltofrontend.go
+++ b/internal/typeutils/internaltofrontend.go
@@ -1383,11 +1383,13 @@ func (c *Converter) baseStatusToFrontend(
InteractionPolicy: *apiInteractionPolicy,
}
- // Nullable fields.
- if !s.UpdatedAt.Equal(s.CreatedAt) {
+ // Only set edited_at if this is a non-boost-wrapper
+ // with an updated_at date different to creation date.
+ if !s.UpdatedAt.Equal(s.CreatedAt) && s.BoostOfID == "" {
timestamp := util.FormatISO8601(s.UpdatedAt)
apiStatus.EditedAt = util.Ptr(timestamp)
}
+
apiStatus.InReplyToID = util.PtrIf(s.InReplyToID)
apiStatus.InReplyToAccountID = util.PtrIf(s.InReplyToAccountID)
apiStatus.Language = util.PtrIf(s.Language)