From 1b038d3fdc128d6b7b370ea6698d7b0ce082b73b Mon Sep 17 00:00:00 2001 From: flisk Date: Fri, 24 Feb 2023 00:23:53 +0100 Subject: [PATCH] fix realtime updates in 'following' replies filter i'm not sure how this code was supposed to work, but the way it was written would only add statuses to the timeline if they were in reply to someone the user is following and erroneously filter out posts that aren't replies. --- src/modules/api.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/modules/api.js b/src/modules/api.js index 8de1449b..352d7774 100644 --- a/src/modules/api.js +++ b/src/modules/api.js @@ -5,15 +5,25 @@ import { map } from 'lodash' const retryTimeout = (multiplier) => 1000 * multiplier const isVisible = (store, message, visibility) => { - if (visibility === 'all') { + if (visibility == 'all') { return true - } else if (visibility === 'following') { - return store.getters.relationship(message.in_reply_to_user_id).following - } else if (visibility === 'self') { + } + + if (visibility == 'following') { + if (message.in_reply_to_user_id === null) { + return true + } else { + return store.getters.relationship(message.in_reply_to_user_id).following + } + } + + if (visibility == 'self') { return message.in_reply_to_user_id === store.rootState.users.currentUser.id } + return false } + const api = { state: { retryMultiplier: 1,