ssb: Try harder to not show off-channel messages in the general feed.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 18m35s

This commit is contained in:
2025-10-27 12:56:04 -04:00
parent 732089da2c
commit b3604039fa
2 changed files with 5 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
{
"type": "tildefriends-app",
"emoji": "🦀",
"previous": "&eAjYZEvYgIFuc1RGphOEtr21HMnhCMUe3ppKJ3e+IwM=.sha256"
"previous": "&fzy0c20XeWQZt1G4nCmWgPeS/NfGdMzy3k79Fd0OkQM=.sha256"
}

View File

@@ -263,6 +263,10 @@ class TfTabNewsFeedElement extends LitElement {
JOIN json_each(?1) AS following ON messages.author = following.value
WHERE messages.timestamp < ?3 AND (?2 IS NULL OR messages.timestamp >= ?2) AND
messages.content ->> 'type' != 'vote' AND
(messages.content ->> 'root' IS NULL OR (
NOT EXISTS (SELECT * FROM messages root JOIN channels ON ('#' || (root.content ->> 'channel')) = channels.value WHERE root.id = messages.content ->> 'root') AND
NOT EXISTS (SELECT * FROM messages root JOIN messages_refs ON root.id = messages.content ->> 'root' JOIN channels ON messages_refs.message = root.id AND messages_refs.ref = channels.value)
)) AND
(messages.content ->> 'channel' IS NULL OR ('#' || (messages.content ->> 'channel')) NOT IN (SELECT * FROM channels)) AND
NOT EXISTS (SELECT * FROM messages_refs JOIN channels ON messages_refs.message = messages.id AND messages_refs.ref = channels.value)
ORDER BY timestamp DESC LIMIT ?4