damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 071a4209ea75a7468276c2f7b5cc707a8e116007
parent 7f385b2e7eda95d83ff0ca0ee14f75d95c84fcca
Author: William Casarin <jb55@jb55.com>
Date:   Wed,  1 Mar 2023 10:51:49 -0800

Only send lud12 comment if its not a private zap

Diffstat:
Mdamus/Util/Zap.swift | 12++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/damus/Util/Zap.swift b/damus/Util/Zap.swift @@ -310,7 +310,7 @@ func fetch_zap_invoice(_ payreq: LNUrlPayRequest, zapreq: NostrEvent?, sats: Int } // add a lud12 comment as well if we have it - if let comment, let limit = payreq.commentAllowed, limit != 0 { + if zap_type != .priv, let comment, let limit = payreq.commentAllowed, limit != 0 { let limited_comment = String(comment.prefix(limit)) query.append(URLQueryItem(name: "comment", value: limited_comment)) } @@ -323,7 +323,15 @@ func fetch_zap_invoice(_ payreq: LNUrlPayRequest, zapreq: NostrEvent?, sats: Int print("url \(url)") - guard let ret = try? await URLSession.shared.data(from: url) else { + var ret: (Data, URLResponse)? = nil + do { + ret = try await URLSession.shared.data(from: url) + } catch { + print(error.localizedDescription) + return nil + } + + guard let ret else { return nil }