Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed Oct 11, 2024
1 parent 3aed78d commit 8d318e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion outbox/forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func ForwardActivity[T ap.RawActivity](ctx context.Context, domain string, cfg *
}

var shouldForward int
if err := tx.QueryRowContext(ctx, `select exists (select 1 from notes join persons on persons.id = notes.author and (notes.public = 1 or exists (select 1 from json_each(notes.object->'$.to') where value = persons.actor->>'$.followers') or exists (select 1 from json_each(notes.object->'$.cc') where value = persons.actor->>'$.followers')) where notes.id = ? and notes.author != ?)`, firstPostID, activity.Actor).Scan(&shouldForward); err != nil {
if err := tx.QueryRowContext(ctx, `select exists (select 1 from notes join persons on persons.id = notes.author and (notes.public = 1 or exists (select 1 from json_each(notes.object->'$.to') where value = persons.actor->>'$.followers') or exists (select 1 from json_each(notes.object->'$.cc') where value = persons.actor->>'$.followers')) where notes.id = ?)`, firstPostID, activity.Actor).Scan(&shouldForward); err != nil {
return err
}
if shouldForward == 0 {
Expand Down

0 comments on commit 8d318e9

Please sign in to comment.