From 1c2d7a67931476461e12af7e25cca2e010516292 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 3 Apr 2025 12:38:39 -0500 Subject: [PATCH] Index client addr in search extensions --- packages/ditto/storages/DittoPgStore.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/ditto/storages/DittoPgStore.ts b/packages/ditto/storages/DittoPgStore.ts index 63d32d56..5152ec09 100644 --- a/packages/ditto/storages/DittoPgStore.ts +++ b/packages/ditto/storages/DittoPgStore.ts @@ -522,6 +522,12 @@ export class DittoPgStore extends NPostgres { } } + const client = event.tags.find(([name]) => name === 'client')?.[2]; + + if (client && /^31990:([0-9a-f]{64}):(.+)$/.test(client)) { + ext.client = client; + } + ext.protocol = event.tags.find(([name]) => name === 'proxy')?.[2] ?? 'nostr'; return ext;