From 7bb7faa86ccc4c91555b82464ed0065ac7c0c2bb Mon Sep 17 00:00:00 2001 From: Ayo Ayco Date: Fri, 19 Apr 2024 20:27:31 +0200 Subject: [PATCH] feat: filter out replies to other accounts than original author --- app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 74f871c..7be8878 100755 --- a/app.py +++ b/app.py @@ -11,14 +11,15 @@ def home(): threads = [] for id in thread_ids: status = requests.get(server + '/api/v1/statuses/' + id ).json() - author = status['account']['acct'] + author = status['account']['id'] context = requests.get(server + '/api/v1/statuses/' + id + '/context').json() descendants = [] for reply in context['descendants']: - if reply['account']['acct'] == author: + if reply['account']['id'] == author and reply['in_reply_to_account_id'] == author: descendants.append(clean_status(reply)) status = clean_status(status) status['descendants'] = descendants + status['descendants_count'] = len(descendants) threads.append(status) return threads