mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-25 10:19:06 +01:00
[mastodon-client] Fix renoteMuting for streaming API
This commit is contained in:
parent
10865168bf
commit
d025177d2c
@ -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 New Issue
Block a user