Bluesky app fork with some witchin' additions 💫

Filter activity notifs for muted words (#8637)

authored by samuel.fm and committed by

GitHub 0e3124a9 8f5a8f37

+18
+18
src/state/queries/notifications/util.ts
··· 7 7 AppBskyGraphStarterpack, 8 8 type AppBskyNotificationListNotifications, 9 9 type BskyAgent, 10 + hasMutedWord, 10 11 moderateNotification, 11 12 type ModerationOpts, 12 13 } from '@atproto/api' ··· 124 125 } 125 126 if (!moderationOpts) { 126 127 return false 128 + } 129 + if ( 130 + notif.reason === 'subscribed-post' && 131 + bsky.dangerousIsType<AppBskyFeedPost.Record>( 132 + notif.record, 133 + AppBskyFeedPost.isRecord, 134 + ) && 135 + hasMutedWord({ 136 + mutedWords: moderationOpts.prefs.mutedWords, 137 + text: notif.record.text, 138 + facets: notif.record.facets, 139 + outlineTags: notif.record.tags, 140 + languages: notif.record.langs, 141 + actor: notif.author, 142 + }) 143 + ) { 144 + return true 127 145 } 128 146 if (notif.author.viewer?.following) { 129 147 return false