Skip to content

Commit

Permalink
fix breakage of polls
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed Dec 30, 2023
1 parent 35a9bc6 commit 2df893f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions front/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@ func post(w text.Writer, r *request, inReplyTo *ap.Object, to ap.Audience, cc ap

hash := sha256.Sum256([]byte(postID))

if inReplyTo == nil || inReplyTo.Type != ap.QuestionObject {
content = plain.ToHTML(content)
}

note := ap.Object{
Type: ap.NoteObject,
ID: postID,
Expand Down Expand Up @@ -198,6 +194,10 @@ func post(w text.Writer, r *request, inReplyTo *ap.Object, to ap.Audience, cc ap
note.EndTime = &endTime
}

if inReplyTo == nil || inReplyTo.Type != ap.QuestionObject {
note.Content = plain.ToHTML(note.Content)
}

if err := outbox.Create(r.Context, r.Log, r.DB, &note, r.User); err != nil {
r.Log.Error("Failed to insert post", "error", err)
if errors.Is(err, outbox.ErrDeliveryQueueFull) {
Expand Down

0 comments on commit 2df893f

Please sign in to comment.