diff --git a/src/controllers/api/streaming.ts b/src/controllers/api/streaming.ts index ff47c07..04cfbbc 100644 --- a/src/controllers/api/streaming.ts +++ b/src/controllers/api/streaming.ts @@ -9,6 +9,7 @@ import { bech32ToPubkey } from '@/utils.ts'; import { renderReblog, renderStatus } from '@/views/mastodon/statuses.ts'; import { hydrateEvents } from '@/storages/hydrate.ts'; import { Storages } from '@/storages.ts'; +import { MuteListPolicy } from '@/policies/MuteListPolicy.ts'; const debug = Debug('ditto:streaming'); @@ -75,6 +76,14 @@ const streamingController: AppController = (c) => { if (msg[0] === 'EVENT') { const event = msg[2]; + if (pubkey) { + const policy = new MuteListPolicy(pubkey, await Storages.admin()); + const ok = await policy.call(event); + if (ok[2] === false) { + continue; + } + } + await hydrateEvents({ events: [event], store: optimizer,