[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
No known key found for this signature in database
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> { private async shouldProcessNote(note: Note | Packed<"Note">): Promise<boolean> {
if (!this.listUsers.includes(note.userId)) return false; if (!this.listUsers.includes(note.userId)) return false;
if (note.channelId) 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 (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 === "specified") return !!note.visibleUserIds?.includes(this.user.id);
if (note.visibility === "followers") return this.following.has(note.userId); 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 (isInstanceMuted(note, new Set<string>(this.userProfile?.mutedInstances ?? []))) return false;
if (isUserRelated(note, this.muting)) return false; if (isUserRelated(note, this.muting)) return false;
if (isUserRelated(note, this.blocking)) 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; if (this.userProfile && (await getWordHardMute(note, this.user, this.userProfile.mutedWords))) return false;
return true; 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 (isInstanceMuted(note, new Set<string>(this.userProfile?.mutedInstances ?? []))) return false;
if (isUserRelated(note, this.muting)) return false; if (isUserRelated(note, this.muting)) return false;
if (isUserRelated(note, this.blocking)) 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; if (this.userProfile && (await getWordHardMute(note, this.user, this.userProfile.mutedWords))) return false;
return true; return true;

View File

@ -98,7 +98,7 @@ export class MastodonStreamUser extends MastodonStream {
if (isUserRelated(note, this.muting)) return false; if (isUserRelated(note, this.muting)) return false;
if (isUserRelated(note, this.blocking)) return false; if (isUserRelated(note, this.blocking)) return false;
if (isUserRelated(note, this.hidden)) 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; if (this.userProfile && (await getWordHardMute(note, this.user, this.userProfile.mutedWords))) return false;
return true; return true;