replace deprecated functions in multiple places.

This commit is contained in:
fiatjaf
2025-03-10 02:54:34 -03:00
parent 8d869009b0
commit 459273216c
7 changed files with 19 additions and 27 deletions

View File

@@ -94,12 +94,12 @@ func (p *DynamicSigner) HandleRequest(ctx context.Context, event *nostr.Event) (
fmt.Errorf("event kind is %d, but we expected %d", event.Kind, nostr.KindNostrConnect)
}
handler := event.Tags.GetFirst([]string{"p", ""})
if handler == nil || !nostr.IsValid32ByteHex((*handler)[1]) {
handler := event.Tags.Find("p")
if handler == nil || !nostr.IsValid32ByteHex(handler[1]) {
return req, resp, eventResponse, fmt.Errorf("invalid \"p\" tag")
}
handlerPubkey := (*handler)[1]
handlerPubkey := handler[1]
handlerSecret, err := p.getHandlerSecretKey(handlerPubkey)
if err != nil {
return req, resp, eventResponse, fmt.Errorf("no private key for %s: %w", handlerPubkey, err)