mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-29 12:03:57 +00:00
[Glitch] Do not empty timeline of blocked users on block
Port 94aceb85ad
to glitch-soc
This commit is contained in:
parent
b9f314bba7
commit
d680c61993
|
@ -73,14 +73,15 @@ const updateTimeline = (state, timeline, status) => {
|
|||
}));
|
||||
};
|
||||
|
||||
const deleteStatus = (state, id, accountId, references) => {
|
||||
const deleteStatus = (state, id, accountId, references, exclude_account = null) => {
|
||||
state.keySeq().forEach(timeline => {
|
||||
if (exclude_account === null || (timeline !== `account:${exclude_account}` && !timeline.startsWith(`account:${exclude_account}:`)))
|
||||
state = state.updateIn([timeline, 'items'], list => list.filterNot(item => item === id));
|
||||
});
|
||||
|
||||
// Remove reblogs of deleted status
|
||||
references.forEach(ref => {
|
||||
state = deleteStatus(state, ref[0], ref[1], []);
|
||||
state = deleteStatus(state, ref[0], ref[1], [], exclude_account);
|
||||
});
|
||||
|
||||
return state;
|
||||
|
@ -99,7 +100,7 @@ const filterTimelines = (state, relationship, statuses) => {
|
|||
}
|
||||
|
||||
references = statuses.filter(item => item.get('reblog') === status.get('id')).map(item => [item.get('id'), item.get('account')]);
|
||||
state = deleteStatus(state, status.get('id'), status.get('account'), references);
|
||||
state = deleteStatus(state, status.get('id'), status.get('account'), references, relationship.id);
|
||||
});
|
||||
|
||||
return state;
|
||||
|
|
Loading…
Reference in a new issue