From 0f2fe72172d9db56f195430ad13bd2761b211b1d Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Tue, 4 Nov 2025 16:23:25 -0800 Subject: [PATCH] Upgrade nostrlib --- go.mod | 2 +- go.sum | 2 ++ zooid/instance.go | 2 +- zooid/management.go | 10 ++++++---- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 9cbd61b..1f7c42b 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module zooid go 1.24.1 require ( - fiatjaf.com/nostr v0.0.0-20250924142401-59bd3c29fffd + fiatjaf.com/nostr v0.0.0-20251104112613-38a6ca92b954 github.com/BurntSushi/toml v1.5.0 github.com/Masterminds/squirrel v1.5.4 github.com/fsnotify/fsnotify v1.9.0 diff --git a/go.sum b/go.sum index 0e2e3d9..9734010 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ fiatjaf.com/nostr v0.0.0-20250924142401-59bd3c29fffd h1:LnbRz+TxZAROXglKFT+Lqsdqe5Pu8PG0rSpmXGnES90= fiatjaf.com/nostr v0.0.0-20250924142401-59bd3c29fffd/go.mod h1:Nq86Jjsd0OmsOEImUg0iCcLuqM5B67Nj2eu/2dP74Ss= +fiatjaf.com/nostr v0.0.0-20251104112613-38a6ca92b954 h1:CMD8D3TgEjGhuIBNMnvZ0EXOW0JR9O3w8AI6Yuzt8Ec= +fiatjaf.com/nostr v0.0.0-20251104112613-38a6ca92b954/go.mod h1:Nq86Jjsd0OmsOEImUg0iCcLuqM5B67Nj2eu/2dP74Ss= github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg= github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/ImVexed/fasturl v0.0.0-20230304231329-4e41488060f3 h1:ClzzXMDDuUbWfNNZqGeYq4PnYOlwlOVIvSyNaIy0ykg= diff --git a/zooid/instance.go b/zooid/instance.go index 9652ee7..40f483b 100644 --- a/zooid/instance.go +++ b/zooid/instance.go @@ -245,7 +245,7 @@ func (instance *Instance) OnConnect(ctx context.Context) { khatru.RequestAuth(ctx) } -func (instance *Instance) PreventBroadcast(ws *khatru.WebSocket, event nostr.Event) bool { +func (instance *Instance) PreventBroadcast(ws *khatru.WebSocket, filter nostr.Filter, event nostr.Event) bool { return instance.IsWriteOnlyEvent(event) } diff --git a/zooid/management.go b/zooid/management.go index 4b6f118..3132431 100644 --- a/zooid/management.go +++ b/zooid/management.go @@ -31,10 +31,12 @@ type ManagementStore struct { func (m *ManagementStore) GetBannedEventItems() []nip86.IDReason { items := make([]nip86.IDReason, 0) for tag := range m.Events.GetOrCreateApplicationSpecificData(BANNED_EVENTS).Tags.FindAll("event") { - items = append(items, nip86.IDReason{ - ID: tag[1], - Reason: tag[2], - }) + if id, err := nostr.IDFromHex(tag[1]); err == nil { + items = append(items, nip86.IDReason{ + ID: id, + Reason: tag[2], + }) + } } return items