mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-12 18:14:21 +01:00
fix: purify event before publishing to other relays
This commit is contained in:
@@ -14,6 +14,7 @@ import { RelayError } from '@/RelayError.ts';
|
||||
import { AdminSigner } from '@/signers/AdminSigner.ts';
|
||||
import { Storages } from '@/storages.ts';
|
||||
import { nostrNow } from '@/utils.ts';
|
||||
import { purifyEvent } from '@/storages/hydrate.ts';
|
||||
|
||||
const debug = Debug('ditto:api');
|
||||
|
||||
@@ -152,7 +153,7 @@ async function publishEvent(event: NostrEvent, c: AppContext): Promise<NostrEven
|
||||
try {
|
||||
await pipeline.handleEvent(event, c.req.raw.signal);
|
||||
const client = await Storages.client();
|
||||
await client.event(event);
|
||||
await client.event(purifyEvent(event));
|
||||
} catch (e) {
|
||||
if (e instanceof RelayError) {
|
||||
throw new HTTPException(422, {
|
||||
|
||||
Reference in New Issue
Block a user