Fixed timeline filtering
ci/woodpecker/push/ociImageTag Pipeline is pending Details
ci/woodpecker/tag/ociImageTag Pipeline was successful Details

This commit is contained in:
Natty 2023-07-23 11:06:46 +02:00
parent 0e05b6e285
commit 467c609b0f
Signed by: natty
GPG Key ID: BF6CB659ADEE60EC
2 changed files with 17 additions and 0 deletions

View File

@ -30,6 +30,10 @@ export default class extends Channel {
private async onNote(note: Packed<"Note">) {
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
if (
isInstanceMuted(

View File

@ -40,6 +40,19 @@ export default class extends Channel {
if (note.visibility === "hidden")
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
if (
isInstanceMuted(