From be71055ea1f867f169543c5fd0f4bbf967c421b0 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 18 Oct 2020 21:07:55 +0100 Subject: [PATCH] twitterchiver/viewer: restrict viewing to on_timeline tweets We want to only display tweets in the search view that was in timeline, but we do store entries in user_accounts_tweets for ACL purposes for replies/quote tweets. --- go/twitterchiver/viewer/viewer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/go/twitterchiver/viewer/viewer.go b/go/twitterchiver/viewer/viewer.go index 0bf58fc551..54041781c1 100644 --- a/go/twitterchiver/viewer/viewer.go +++ b/go/twitterchiver/viewer/viewer.go @@ -193,6 +193,7 @@ INNER JOIN INNER JOIN tweets t ON t.id=uat.tweetid WHERE 1=1 AND ua.username=$1 + AND uat.on_timeline AND ($3::bigint=0 OR t.id <= $3::bigint) AND ($4='' OR ($4<>'' AND (to_tsvector('english', text) @@ to_tsquery('english', $4) OR to_tsvector('english', object->'retweeted_status'->>'full_text') @@ to_tsquery('english', $4) OR object->'user'->>'screen_name'=$4))) ORDER BY t.id DESC