Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed Oct 26, 2024
1 parent a56e2a5 commit cae99d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion front/fts.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,15 @@ func (h *Handler) fts(w text.Writer, r *Request, args ...string) {
(
persons.actor->>'$.followers' in (notes.cc0, notes.to0, notes.cc1, notes.to1, notes.cc2, notes.to2) or
(notes.to2 is not null and exists (select 1 from json_each(notes.object->'$.to') where value = persons.actor->>'$.followers')) or
(notes.cc2 is not null and exists (select 1 from json_each(notes.object->'$.cc') where value = persons.actor->>'$.followers'))
(notes.cc2 is not null and exists (select 1 from json_each(notes.object->'$.cc') where value = persons.actor->>'$.followers')) or
(persons.actor->>'$.type' = 'Group' and exists (select 1 from shares where shares.by = groups.id and shares.note = notes.id))
)
join
notesfts on
notesfts.id = notes.id
where
follows.follower = $2 and
follows.accepted = 1 and
notesfts.content match $1
union all
select notes.id, notes.object, notes.author, notes.inserted, rank, 0 as aud from
Expand Down
2 changes: 1 addition & 1 deletion front/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ func (h *Handler) PrintNote(w text.Writer, r *Request, note *ap.Object, author *
join persons on persons.id = shares.by
where shares.note = $1 and persons.host = $3
union all
select persons.id, persons.actor->>'$.preferredUsername' as username, shares.inserted, 4 as rank from shares
select persons.id, persons.actor->>'$.preferredUsername' as username, shares.inserted, 5 as rank from shares
join persons on persons.id = shares.by
where shares.note = $1 and persons.host != $3
)
Expand Down

0 comments on commit cae99d8

Please sign in to comment.