[mastodon-client] Fix renoteMuting for streaming API

This commit is contained in:
Laura Hausmann 2023-10-22 22:53:11 +02:00
parent 10865168bf
commit d025177d2c
Signed by: zotan
GPG key ID: D044E84C5BE01605
4 changed files with 4 additions and 4 deletions

View file

@ -74,7 +74,7 @@ export class MastodonStreamList extends MastodonStream {
private async shouldProcessNote(note: Note | Packed<"Note">): Promise<boolean> {
if (!this.listUsers.includes(note.userId)) return false;
if (note.channelId) return false;
if (note.renote && !note.text && this.renoteMuting.has(note.userId)) return false;
if (note.renoteId !== null && !note.text && this.renoteMuting.has(note.userId)) return false;
if (this.userProfile && (await getWordHardMute(note, this.user, this.userProfile.mutedWords))) return false;
if (note.visibility === "specified") return !!note.visibleUserIds?.includes(this.user.id);
if (note.visibility === "followers") return this.following.has(note.userId);

View file

@ -71,7 +71,7 @@ export class MastodonStreamPublic extends MastodonStream {
if (isInstanceMuted(note, new Set<string>(this.userProfile?.mutedInstances ?? []))) return false;
if (isUserRelated(note, this.muting)) return false;
if (isUserRelated(note, this.blocking)) return false;
if (note.renote && !isQuote(note) && this.renoteMuting.has(note.userId)) return false;
if (note.renoteId !== null && !isQuote(note) && this.renoteMuting.has(note.userId)) return false;
if (this.userProfile && (await getWordHardMute(note, this.user, this.userProfile.mutedWords))) return false;
return true;

View file

@ -63,7 +63,7 @@ export class MastodonStreamTag extends MastodonStream {
if (isInstanceMuted(note, new Set<string>(this.userProfile?.mutedInstances ?? []))) return false;
if (isUserRelated(note, this.muting)) return false;
if (isUserRelated(note, this.blocking)) return false;
if (note.renote && !isQuote(note) && this.renoteMuting.has(note.userId)) return false;
if (note.renoteId !== null && !isQuote(note) && this.renoteMuting.has(note.userId)) return false;
if (this.userProfile && (await getWordHardMute(note, this.user, this.userProfile.mutedWords))) return false;
return true;

View file

@ -98,7 +98,7 @@ export class MastodonStreamUser extends MastodonStream {
if (isUserRelated(note, this.muting)) return false;
if (isUserRelated(note, this.blocking)) return false;
if (isUserRelated(note, this.hidden)) return false;
if (note.renote && !isQuote(note) && this.renoteMuting.has(note.userId)) return false;
if (note.renoteId !== null && !isQuote(note) && this.renoteMuting.has(note.userId)) return false;
if (this.userProfile && (await getWordHardMute(note, this.user, this.userProfile.mutedWords))) return false;
return true;