mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-02 21:24:23 +01:00
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:
@@ -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),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user