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

@@ -9,6 +9,7 @@ import { z } from 'zod';
import { type AppContext } from '@/app.ts';
import { Conf } from '@/config.ts';
import * as pipeline from '@/pipeline.ts';
import { RelayError } from '@/RelayError.ts';
import { AdminSigner } from '@/signers/AdminSigner.ts';
import { APISigner } from '@/signers/APISigner.ts';
import { Storages } from '@/storages.ts';
@@ -103,12 +104,10 @@ async function updateAdminEvent<E extends EventStub>(
async function publishEvent(event: NostrEvent, c: AppContext): Promise<NostrEvent> {
debug('EVENT', event);
try {
await Promise.all([
pipeline.handleEvent(event, c.req.raw.signal),
Storages.client.event(event),
]);
await pipeline.handleEvent(event, c.req.raw.signal);
await Storages.client.event(event);
} catch (e) {
if (e instanceof pipeline.RelayError) {
if (e instanceof RelayError) {
throw new HTTPException(422, {
res: c.json({ error: e.message }, 422),
});