summaryrefslogtreecommitdiff
path: root/internal/typeutils/internaltoas.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-11-11 10:15:04 +0000
committerLibravatar GitHub <noreply@github.com>2023-11-11 10:15:04 +0000
commitdeaea100c37698893e97cf9cab159a3d220ac3cd (patch)
treef48abc96964652d1701d91c88a00174c8f1b0196 /internal/typeutils/internaltoas.go
parent[feature] Media attachment placeholders (#2331) (diff)
downloadgotosocial-deaea100c37698893e97cf9cab159a3d220ac3cd.tar.xz
[bugfix] support endless polls, and misskey's' method of inferring expiry in closed polls (#2349)
Diffstat (limited to 'internal/typeutils/internaltoas.go')
-rw-r--r--internal/typeutils/internaltoas.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/typeutils/internaltoas.go b/internal/typeutils/internaltoas.go
index 541e2f4d1..16467be40 100644
--- a/internal/typeutils/internaltoas.go
+++ b/internal/typeutils/internaltoas.go
@@ -708,8 +708,10 @@ func (c *Converter) addPollToAS(ctx context.Context, poll *gtsmodel.Poll, dst ap
optionsProp.AppendActivityStreamsNote(note)
}
- // Set poll endTime property.
- ap.SetEndTime(dst, poll.ExpiresAt)
+ if !poll.ExpiresAt.IsZero() {
+ // Set poll endTime property.
+ ap.SetEndTime(dst, poll.ExpiresAt)
+ }
if !poll.ClosedAt.IsZero() {
// Poll is closed, set closed property.