From af9fb6aaa30eb4abd27ebe815478276125fa84fe Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 14 May 2024 20:05:38 -0500 Subject: [PATCH] Sort imports of streaming.ts --- src/RelayError.ts | 2 +- src/controllers/api/streaming.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/RelayError.ts b/src/RelayError.ts index 1d275f63..0b01de3e 100644 --- a/src/RelayError.ts +++ b/src/RelayError.ts @@ -16,7 +16,7 @@ export class RelayError extends Error { /** Throw a new RelayError if the OK message is false. */ static assert(msg: NostrRelayOK): void { - const [_, _eventId, ok, reason] = msg; + const [, , ok, reason] = msg; if (!ok) { throw RelayError.fromReason(reason); } diff --git a/src/controllers/api/streaming.ts b/src/controllers/api/streaming.ts index 04cfbbc4..e3852d97 100644 --- a/src/controllers/api/streaming.ts +++ b/src/controllers/api/streaming.ts @@ -4,12 +4,12 @@ import { z } from 'zod'; import { type AppController } from '@/app.ts'; import { Conf } from '@/config.ts'; +import { MuteListPolicy } from '@/policies/MuteListPolicy.ts'; import { getFeedPubkeys } from '@/queries.ts'; -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'; +import { bech32ToPubkey } from '@/utils.ts'; +import { renderReblog, renderStatus } from '@/views/mastodon/statuses.ts'; const debug = Debug('ditto:streaming'); @@ -78,8 +78,8 @@ const streamingController: AppController = (c) => { if (pubkey) { const policy = new MuteListPolicy(pubkey, await Storages.admin()); - const ok = await policy.call(event); - if (ok[2] === false) { + const [, , ok] = await policy.call(event); + if (!ok) { continue; } }