chadtmiller.com/knotless
git that lives in your Atmosphere account
1
10
What each notification says is found for its page alone
crates/knotless-serve/src/index.rs+11−4
| @@ -1950,9 +1950,11 @@ impl Index { | ||
-- The reasons it turned off. | ||
off(reason) AS (SELECT j.value FROM pref p, json_each(p.value, '$.off') j | ||
WHERE p.did = ?1 AND p.kind = 'notifications') | ||
SELECT n.uri, n.author, n.reason, | ||
CASE WHEN n.reason = 'star' THEN r.uri ELSE n.subject END, | ||
r.did, r.name, n.title, n.at, n.verdict, | ||
-- What is said of each is found for the page alone, outside | ||
-- its limit: a column is worked out for every row before a | ||
-- sort, and the rows sorted are all the account ever heard of. | ||
SELECT n.uri, n.author, n.reason, n.shown, n.owner, n.name, n.title, n.at, | ||
n.verdict, | ||
-- Named in it too, though heard of for another reason. | ||
n.reason != 'mention' | ||
AND EXISTS (SELECT 1 FROM mention m WHERE m.uri = n.uri AND m.did = ?1), | ||
| @@ -1963,6 +1965,9 @@ impl Index { | ||
AND lf.value ->> '$.review' = n.uri) | ||
END, | ||
n.role, n.checks, n.body, n.reviewed | ||
FROM ( | ||
SELECT n.*, CASE WHEN n.reason = 'star' THEN r.uri ELSE n.subject END AS shown, | ||
r.did AS owner, r.name AS name | ||
FROM ( | ||
SELECT uri, did AS author, 'star' AS reason, NULL AS subject, | ||
repo_did, repo_key, NULL AS title, created_at AS at, NULL AS verdict, | ||
| @@ -2204,7 +2209,9 @@ impl Index { | ||
OR instr(n.uri, '/dev.knotless.issue/'))))) | ||
OR (?6 = 'checks' AND n.reason IN ('checks-failed', 'ejected')) | ||
OR (?6 = 'stars-and-follows' AND n.reason IN ('star', 'follow'))) | ||
ORDER BY n.at DESC, n.uri DESC LIMIT ?4", | ||
ORDER BY n.at DESC, n.uri DESC LIMIT ?4 | ||
) n | ||
ORDER BY n.at DESC, n.uri DESC", | ||
member = nsid::ORG_MEMBER, | ||
lapse = knotless::org::LAPSE_SECS, | ||
))?; | ||