Merge branch 'block-globally-muted-user-to-post' into 'main'

Do not allow deactivated accounts to post

Closes #118

See merge request soapbox-pub/ditto!245
This commit is contained in:
Alex Gleason
2024-05-14 19:46:36 +00:00
7 changed files with 62 additions and 37 deletions

View File

@@ -10,6 +10,7 @@ import {
} from '@nostrify/nostrify';
import { relayInfoController } from '@/controllers/nostr/relay-info.ts';
import * as pipeline from '@/pipeline.ts';
import { RelayError } from '@/RelayError.ts';
import { Storages } from '@/storages.ts';
import type { AppController } from '@/app.ts';
@@ -95,7 +96,7 @@ function connectStream(socket: WebSocket) {
await pipeline.handleEvent(event, AbortSignal.timeout(1000));
send(['OK', event.id, true, '']);
} catch (e) {
if (e instanceof pipeline.RelayError) {
if (e instanceof RelayError) {
send(['OK', event.id, false, e.message]);
} else {
send(['OK', event.id, false, 'error: something went wrong']);