Fixed timeline filtering
This commit is contained in:
parent
0e05b6e285
commit
467c609b0f
|
@ -30,6 +30,10 @@ export default class extends Channel {
|
||||||
private async onNote(note: Packed<"Note">) {
|
private async onNote(note: Packed<"Note">) {
|
||||||
if (note.visibility === "hidden") return;
|
if (note.visibility === "hidden") return;
|
||||||
|
|
||||||
|
// Filter away notes that are not authored by the user or any of the followed users
|
||||||
|
if (this.user!.id !== note.userId && !this.following.has(note.userId))
|
||||||
|
return;
|
||||||
|
|
||||||
// Ignore notes from instances the user has muted
|
// Ignore notes from instances the user has muted
|
||||||
if (
|
if (
|
||||||
isInstanceMuted(
|
isInstanceMuted(
|
||||||
|
|
|
@ -40,6 +40,19 @@ export default class extends Channel {
|
||||||
if (note.visibility === "hidden")
|
if (note.visibility === "hidden")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Drop notes that don't match at least one of these conditions:
|
||||||
|
// - The user is the author
|
||||||
|
// - The user is following the author
|
||||||
|
// - The note is public and the author is local
|
||||||
|
if (
|
||||||
|
!(
|
||||||
|
this.user!.id === note.userId ||
|
||||||
|
this.following.has(note.userId) ||
|
||||||
|
(note.user.host == null && note.visibility === "public")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return;
|
||||||
|
|
||||||
// Ignore notes from instances the user has muted
|
// Ignore notes from instances the user has muted
|
||||||
if (
|
if (
|
||||||
isInstanceMuted(
|
isInstanceMuted(
|
||||||
|
|
Loading…
Reference in New Issue