From 451d7ca691fc6ebb4b87d91e8141899a5e923377 Mon Sep 17 00:00:00 2001 From: Believethehype Date: Tue, 11 Apr 2023 19:45:39 +0200 Subject: [PATCH] check for anonymous Zaps and show im DM instead of random key --- lnurl.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lnurl.go b/lnurl.go index 1be90d0..5c191ec 100644 --- a/lnurl.go +++ b/lnurl.go @@ -280,11 +280,14 @@ func serveLNURLpSecond(w http.ResponseWriter, params *Params, username string, a if zapEvent.Tags.GetFirst([]string{"e"}) != nil { note = "@" + EncodeBench32Note(zapEvent.Tags.GetFirst([]string{"e"}).Value()) } + if zapEvent.Tags.GetFirst([]string{"anon"}) != nil { + if zapEvent.Tags.GetFirst([]string{"anon"}).Value() == "" { + sender = "anonymous Zapper 🤙" + } + } log.Debug().Str("Zap from", sender).Msg("Nostr") } - //var sender = zapEvent.Tags.GetFirst([]string{"pubkey"}) - decoded_invoice, _ := decodepay.Decodepay(invoice) return LNURLPayValuesCustom{ LNURLResponse: lnurl.LNURLResponse{Status: "OK"},