Skip to content

Commit

Permalink
drop image:{} in local actors
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed Jul 3, 2024
1 parent ef51bad commit ff7a670
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ap/actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type Actor struct {
Followers string `json:"followers,omitempty"`
PublicKey PublicKey `json:"publicKey"`
Icon Array[Attachment] `json:"icon,omitempty"`
Image Attachment `json:"image,omitempty"`
Image *Attachment `json:"image,omitempty"`
ManuallyApprovesFollowers bool `json:"manuallyApprovesFollowers"`
AlsoKnownAs Audience `json:"alsoKnownAs,omitempty"`
Published *Time `json:"published"`
Expand Down
2 changes: 1 addition & 1 deletion front/outbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func (h *Handler) userOutbox(w text.Writer, r *request, args ...string) {
showSeparator = true
}

if offset == 0 && actor.Image.URL != "" {
if offset == 0 && actor.Image != nil && actor.Image.URL != "" {
w.Link(actor.Image.URL, "Header")
showSeparator = true
}
Expand Down
11 changes: 11 additions & 0 deletions migrations/030_noimage.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package migrations

import (
"context"
"database/sql"
)

func noimage(ctx context.Context, domain string, tx *sql.Tx) error {
_, err := tx.ExecContext(ctx, `UPDATE persons SET actor = json_remove(actor, '$.image') WHERE host = ?`, domain)
return err
}

0 comments on commit ff7a670

Please sign in to comment.