mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-28 21:08:52 -07:00
[mastodon-client] Fix renoteMuting for streaming API
This commit is contained in:
parent
10865168bf
commit
d025177d2c
4 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue